Re: PS/2 controller acting weird
Posted: Sun Mar 17, 2013 10:58 pm
Hi,
For the PS/2 controller itself (assuming you don't care about getting PS/2 devices working), there's only really the reset line (which must have a sane power-on default state to avoid "infinitely rebooting") and A20 (which must have a sane power-on default state to allow the CPU to execute the firmware's code). I can't see why the firmware/loader would need to touch it at all.
The other reason is that I don't really care about booting my OS from ROM myself; and only care about making sure other people can boot my OS from ROM. The idea of the "Bochs ROM" was to provide an example (and framework, and documentation) that other people (e.g. someone planning to manufacture thousands of embedded devices) could use as a starting point.
Cheers,
Brendan
Wow, I would never have guessed...rdos wrote:Doing this in Bochs is not a realistic scenario since you don't need to initialize the chipset in Bochs.Brendan wrote:I've done it with Bochs (e.g. where the normal "BIOS-bochs-latest" ROM image is replaced by my ROM image that contains my OS).
It was actually relatively easy; partly because for Bochs you don't need to initialise some things that you normally would (e.g. memory controller - unlike real hardware the RAM just works at power on),
Obviously you'd choose hardware where it's easy to get the chipset's datasheet (and for Intel's chipsets, it's usually easy to get the datasheet/s). For configuring the chipset you can split things into 3 groups - stuff that has sane power-on defaults that you don't need to care about, stuff that the OS can do (MTRRs, PIC/IO APIC, all PCI, etc), and stuff that the firmware/loader would have to take care of.rdos wrote:Part of initializing the chipset is initializing the PS/2 controller, as most chipsets have registers related to that. Chipset initialization on modern machines is very complex, and chipset manuals are 1000s of pages if they are available at all. This was more interesting on 386 and 486 processors / chipsets. I don't think I'd do this on latter systems.
For the PS/2 controller itself (assuming you don't care about getting PS/2 devices working), there's only really the reset line (which must have a sane power-on default state to avoid "infinitely rebooting") and A20 (which must have a sane power-on default state to allow the CPU to execute the firmware's code). I can't see why the firmware/loader would need to touch it at all.
Yes - this is the main reason I haven't attempted to install my OS in a real computer's ROM. I have looked into it though (the easiest way would be something like this device).rdos wrote:Another issue would be how to keep the system alive if you download something that malfunctions. At the very minimum, you would need some spare flash chips, a tool to remove the flash, and a programmer to even consider this. Although it might be interesting to see if the computer sellers technical support can solve such an issue.
The other reason is that I don't really care about booting my OS from ROM myself; and only care about making sure other people can boot my OS from ROM. The idea of the "Bochs ROM" was to provide an example (and framework, and documentation) that other people (e.g. someone planning to manufacture thousands of embedded devices) could use as a starting point.
If you're making thousands of devices it'd make sense (e.g. smartphone, tablet, GPS, smartTV, etc); especially if the hardware is custom designed for the device. If you're only making a small number of devices it probably wouldn't make sense.rdos wrote:I think it would be possible to boot real machines in sub-seconds by replacing BIOS, but it seems like a lot of work.Brendan wrote:Also note that it was extremely fast. Normally Bochs BIOS takes half a second initialising irrelevant/unnecessary stuff and then my code takes another half a second or so to load data from disk. Getting rid of the BIOS and the disk IO means the OS booted in 1 second instead of 3 seconds.
Cheers,
Brendan