--------------------- Booting your computer --------------------- In issue 1, I showed you how to reboot the computer. I didn't explain how it worked. So, here you go, your computer boots like so: 1-Power switch turned on. 2-Power supply performs a POST test. This check to make sure power goes to all parts of your computer, the voltage is right, and the current from the wall is at a steady flow. If you have an AT keyboard (all of you should), the LEDs blink once during this phase. 3-The timing chip on your motherboard sends the OK signal to your Processor, telling it to stop resetting. Until the processor receives this, It keeps resetting itself, and is incapable of any work. 4-The processor than goes begins to execute ROM BIOS. ROM BIOS is the man behind the curtain. It communicates (for the most part) between the Operating System (DOS, Windows 98) and the hardware. IBM did a good thing however. They saw that as the computer grew, the BIOS would change to work with the advancing technology. So, they decided to have the BIOS ALWAYS go to FFFF:0000 in memory. At this location is a JMP command. JMP is an Assembler command just like GOTO. JMP gives the address of the where the BIOS started. What this means, that even though every BIOS is different in size and location, ALL computers have the address of where the BIOS is written at address FFFF:0000. So, On my old IBM XT and on a Pentium II, the computer has to look at address FFFF:0000 to find the correct address of the operating system. So, to reboot the computer, you simply go to the address at FFFF:0000 and do the JMP instruction there. This works of every computer that follows IBM PC-compatible. I have heard AT&T, old TI, and old HP computers don't work like this, but you will not find them around anymore. To DO an instruction you use "Call Absolute" in Qbasic. You must start any compiling form of Qbasic (such as QB4.5 or QB7.x) with "qb /l" for "Call Absolute" to be recognized. 5-9-BIOS scans for a Video card, and other Card with onboard BIOS systems. (such as a SCSI adapter, Network card, or EIDE card) If one is found, it is checked. 10-BIOS checks the WORD value at address 0000:0472 for a value of 1234h. A WORD is 2 bytes (16 bits). If this word = 1234h, then this means the Computer does a Warm boot. A Warm boot is like you hit the reset button. The computer resets, but doesn't do a RAM test(or some other tests for that matter). If the word at 0000:0472 doesn't = 1234h, then a Cold boot is done. A cold boot is as if the power had been off, and you turned the computer on. The computer scans for a Video card, and does a RAM test. Also, for some reason "OUT &h64, &hfe" reboots your machine as well. I don't understand this. OUT is for ports, like serial and printer ports, the speaker, and other weird stuff like that. This only works on 386+ machines. Because of this, I believe it has something to do with the ability of 386+ chips to switch into different modes. But I really don't know. I got a lot of crap from people slamming me, saying that OUT was the best way. Well, none of those Bastards could tell me how it worked, so I shut them up pretty fast. -------------------------------------------------------------------------------- This tutorial originally appeared in the QBasic Developers Forum, Issue #3. This was written by Lord Acidus.