History log of /haiku/src/system/boot/platform/openfirmware/console.cpp
Revision Date Author Comments
# 7d41530f 28-Oct-2021 Augustin Cavalier <waddlesplash@gmail.com>

openfirmware: Refactor console implementation following bootloader changes.

Confirmed working on sparc

Change-Id: I60bf82978ccf967e7e10611f6360cadccf22d15d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4667
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 4aa9da68 19-Jul-2020 PulkoMandy <pulkomandy@pulkomandy.tk>

openboot: fix console to work on both serial and screen

- Use the correct escape sequence for reverse video
- The vertical form feed does not cleanr the screen on normal serial
terminals, so additionally use the clear screen sequence


# 9ebce098 05-Dec-2019 PulkoMandy <pulkomandy@pulkomandy.tk>

openfirmware: alternate implementation for console

If I understand the openboot specification correctly, we should not call
the forth words directly. Instead, we should rely on the
terminal-emulator package to parse ANSI escape sequences and manage the
display for us.

Unfortunately, the ANSI parser is very limited, many sequences don't
work, including the ones for colors. But we can at least have inverse
video, which is good enough to let the menu show.

I think the PowerPC console can be modified to use the same code, at
least partially. So for now I'm keeping this code in a cross-plaform
file.

Change-Id: Ie77b9ddcc18acb735c0d77cb574e28fbabd266e6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1989
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# d5cd4a9d 03-Apr-2019 PulkoMandy <pulkomandy@pulkomandy.tk>

openfirmware: adjust for 64bit

Sparcv9 runs Openboot in 64 bit mode, which means the cell size is
64bit. Use intptr_t where appropriate to make the open firmware calls
work.

Beware, some values are still 32bit, this matters for example for
of_getprop, if you get 32bits into a 64bit variables it will be in the
MSB of it (big endian only weakness...) and confuse things. See for
example in console.cpp, where the input and output handles are retrieved
as 32bit values. It seems wise to check the expected size when using
of_getprop in these cases, instead of just checking for errors.

Change-Id: Ie72ebc4afe7c6d7602a47478f0bfb6b8247004b8
Reviewed-on: https://review.haiku-os.org/c/1369
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# b4aa5d34 18-May-2011 Rene Gollent <anevilyak@gmail.com>

Build fixes.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41578 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 884432c2 24-Aug-2010 Andreas Färber <andreas.faerber@web.de>

boot_loader_openfirmware: Fix style issues

Adjust initializers.
Respect 80-column limit and adjust copyright notice.
Reorder some header groups. Enforce line spacing.

No functional changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38343 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c1cb3fd 21-Aug-2010 Andreas Färber <andreas.faerber@web.de>

boot_loader_openfirmware: Enable boot options by keyboard

Introduce a non-blocking function for checking keyboard input, and refactor
existing code to share the escape key translations. The comment that key-up and
key-down result in a zero char is confirmed to apply.

If the space bar is pressed, enter the boot menu. If the escape key is pressed,
disable the frame buffer and keep showing the usual debug output. Apparently
the key press must come after console/keyboard initialization but before the
"Welcome to the Haiku bootloader!" line.

Closes ticket #6140.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38304 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4d95518e 21-Aug-2010 Andreas Färber <andreas.faerber@web.de>

boot_loader_openfirmware: Avoid console interference with frame buffer

Debug output calls OpenFirmware methods writing text into the frame buffer.
Depending on the screen mode this leads to garbled display or parts of the
screen overwritten, so mute the output during frame buffer use for now.

A better solution would be to redirect the output elsewhere (e.g., #6168),
so that ConsoleHandle::WriteAt() is not called for the problematic handle
in the first place. That does not work inside the kernel yet.

Part of ticket #6105.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38300 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3f0a8328 21-Aug-2010 Andreas Färber <andreas.faerber@web.de>

boot_loader_openfirmware: Coding style fixes

Rearrange copyright notice, reorder #includes.

No functional changes yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38298 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 957a1b17 30-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced new build system variables
{HAIKU,HOST,TARGET}_KERNEL_PIC_{CC,LINK}FLAGS which define the
compiler/linker flags specifying the kind of position independence
the kernel shall have. For x86 we had and still have -fno-pic, but the
PPC kernel has -fPIE (position independent executable) now, as we
need to relocate it.
* The boot loader relocates the kernel now. Mostly copied the relocation
code from the kernel ELF loader. Almost completely rewrote the PPC
specific relocation code, though. It's more correct and more complete now
(some things are still missing though).
* Added boot platform awareness to the kernel. Moved the generic
Open Firmware code (openfirmware.c/h) from the boot loader to the kernel.
* The kernel PPC serial debug output is sent to the console for the time
being.
* The PPC boot loader counts the CPUs now and allocates the kernel stacks
(made OF device iteration a bit more flexible on the way -- the search
can be restricted to subtree). Furthermore we really enter the kernel...
(Yay! :-) ... and crash in the first dprintf() (in the atomic_set()
called by acquire_spinlock()). kprintf() works, though.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15756 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6470bb61 27-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed superfluous static variable I accidentially introduced.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15687 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 44c11fdb 19-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added console support functions required for the generic textual boot
menu. The menu basically works, but has a couple of problems. The
harmless ones are graphical: we get cursor artifacts when the colors
are changed, and the item selection doesn't quite look as it should.
More serious is the lack of Home/End, Page Up/Down keys. All I read from
the console is a '\0' byte when such a key is pressed. The cursor keys
work fortunately. I mapped the functionality of Page Up/Down
additionally to the Left/Right cursor keys. So the menu should be usable
at least. I guess, I'll leave it in that state; Axel wants a graphical
menu anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15589 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7a3fa7d3 19-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

* Followed Ingo's suggestion and removed the now superfluous "length" correction
in ConsoleHandle::WriteAt().
* Updated license.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15581 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8f754974 18-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed endless loop.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15576 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5af32e75 13-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed src/kernel to src/system.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12359 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b4aa5d34cff441f4f4f5f0e5593ecd17f5568ea1 18-May-2011 Rene Gollent <anevilyak@gmail.com>

Build fixes.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41578 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 884432c2da9fbeb1f5e4e4a48ce271b8ad7ee204 24-Aug-2010 Andreas Färber <andreas.faerber@web.de>

boot_loader_openfirmware: Fix style issues

Adjust initializers.
Respect 80-column limit and adjust copyright notice.
Reorder some header groups. Enforce line spacing.

No functional changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38343 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c1cb3fd028568fced526bb59a653831133900cf 21-Aug-2010 Andreas Färber <andreas.faerber@web.de>

boot_loader_openfirmware: Enable boot options by keyboard

Introduce a non-blocking function for checking keyboard input, and refactor
existing code to share the escape key translations. The comment that key-up and
key-down result in a zero char is confirmed to apply.

If the space bar is pressed, enter the boot menu. If the escape key is pressed,
disable the frame buffer and keep showing the usual debug output. Apparently
the key press must come after console/keyboard initialization but before the
"Welcome to the Haiku bootloader!" line.

Closes ticket #6140.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38304 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4d95518e6096da06ce66215034b61b177b5c7a42 21-Aug-2010 Andreas Färber <andreas.faerber@web.de>

boot_loader_openfirmware: Avoid console interference with frame buffer

Debug output calls OpenFirmware methods writing text into the frame buffer.
Depending on the screen mode this leads to garbled display or parts of the
screen overwritten, so mute the output during frame buffer use for now.

A better solution would be to redirect the output elsewhere (e.g., #6168),
so that ConsoleHandle::WriteAt() is not called for the problematic handle
in the first place. That does not work inside the kernel yet.

Part of ticket #6105.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38300 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3f0a83281f024f7104c855ac1791354b89f1880b 21-Aug-2010 Andreas Färber <andreas.faerber@web.de>

boot_loader_openfirmware: Coding style fixes

Rearrange copyright notice, reorder #includes.

No functional changes yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38298 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 957a1b17eb9d13d6dbf164145e82997e16742549 30-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Introduced new build system variables
{HAIKU,HOST,TARGET}_KERNEL_PIC_{CC,LINK}FLAGS which define the
compiler/linker flags specifying the kind of position independence
the kernel shall have. For x86 we had and still have -fno-pic, but the
PPC kernel has -fPIE (position independent executable) now, as we
need to relocate it.
* The boot loader relocates the kernel now. Mostly copied the relocation
code from the kernel ELF loader. Almost completely rewrote the PPC
specific relocation code, though. It's more correct and more complete now
(some things are still missing though).
* Added boot platform awareness to the kernel. Moved the generic
Open Firmware code (openfirmware.c/h) from the boot loader to the kernel.
* The kernel PPC serial debug output is sent to the console for the time
being.
* The PPC boot loader counts the CPUs now and allocates the kernel stacks
(made OF device iteration a bit more flexible on the way -- the search
can be restricted to subtree). Furthermore we really enter the kernel...
(Yay! :-) ... and crash in the first dprintf() (in the atomic_set()
called by acquire_spinlock()). kprintf() works, though.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15756 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6470bb615284f792ba9f2151d64360f651726ded 27-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed superfluous static variable I accidentially introduced.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15687 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 44c11fdbc1cda4d29d8ed8eb9585a097f43e6d27 19-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added console support functions required for the generic textual boot
menu. The menu basically works, but has a couple of problems. The
harmless ones are graphical: we get cursor artifacts when the colors
are changed, and the item selection doesn't quite look as it should.
More serious is the lack of Home/End, Page Up/Down keys. All I read from
the console is a '\0' byte when such a key is pressed. The cursor keys
work fortunately. I mapped the functionality of Page Up/Down
additionally to the Left/Right cursor keys. So the menu should be usable
at least. I guess, I'll leave it in that state; Axel wants a graphical
menu anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15589 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7a3fa7d368448440e485ce03db59e25625b08c9c 19-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

* Followed Ingo's suggestion and removed the now superfluous "length" correction
in ConsoleHandle::WriteAt().
* Updated license.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15581 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8f754974334ba0d1b36a26b78c79a9501550cf17 18-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed endless loop.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15576 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5af32e752606778be5dd7379f319fe43cb3f6b8c 13-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed src/kernel to src/system.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12359 a95241bf-73f2-0310-859d-f6bbb57e9c96