growlnx wrote:
I don't know if this question was answered before.
You would know if you used the search function.
growlnx wrote:
How can I directly access the hardware without any help from the BIOS and be able to do the things it does (print a character, read keyboard entries, restart the computer ...).
Each of those requires knowledge of their respective subsystems.
Printing a character: If you are working in VGA text mode, then there will be a buffer of 80x25 characters starting at linear address 0xb8000. Each character consists of two bytes: A data byte (containing the character) and an attribute byte (containing the text color). You print characters by writing them there. You have to keep track of the cursor yourself, and if you come across control characters, you have to act on them yourself. You will also have to scroll the screen yourself.
These days I would caution against just assuming VGA text mode. Easier to let GRUB handle it. It will then tell you the base address.
Read keyboard entries: Depends. PS/2 or USB? For PS/2, all you have to do is await a keyboard interrupt and then read the keyboard port. Provided the BIOS set everything up for you. We have a wiki article about initializing the keyboard controller, I'd ask that you refer to it. USB? Well, that is going to be complicated. Because for that you will first need a PCI driver, then a host controller driver for the host controller that you have, then a USB hub driver, and then you can deal with a USB keyboard driver.
Restarting the computer: In most cases, the easiest is to just tripple-fault the computer. Unfortunately, that is not guaranteed to reset everything. For more comprehensive restart support, you will have to look into APM or ACPI.