1.11M Members

Jumping to the next boot device?

 
0
 

Hi everyone,

I'm creating my own OS from scratch, and I'm first producing an installation CD so that I can easily install my kernel on a hard drive.

So far, I've written a CD-based bootstrap loader in NASM that finds a program within the
root directory of the CD, loads it into a known area in memory, and executes it (this uses the ISO-9660 specification). I'll more-than-likely just remain in 16-bit mode to run my installer, and switch to an installer that runs within the kernel once I get far enough (i.e. once I actually have a kernel!).

Now, my plan is to make the CD work like a Windows installation CD; I want it to display a "Press any key to boot from the CD..." prompt, and 'skip' to the next boot device if a key isn't pressed within a certain time limit. The only thing is, I'm not sure what I need to do to skip to the next boot device?

Thanks in advance!

P.S. Please could any example code be written in NASM or pseudo-code? :-)

 
0
 

Not sure how CDs work, but if it was a floppy you would just jump to the next sector. Maybe CDs have something similar?
Good luck, sounds like an interesting project.

http://www.ehow.com/how-does_4896772_cds-work.html

 
0
 

Not sure how CDs work, but if it was a floppy you would just jump to the next sector. Maybe CDs have something similar?
Good luck, sounds like an interesting project.

http://www.ehow.com/how-does_4896772_cds-work.html

Sorry for being a pain, I don't quite understand what you mean by jumping to the next sector, and how it would switch to the next boot device? What I want to do is basically exit the bootloader and transfer control back to the BIOS, making it move onto the next boot device in the sequence. If I don't do this, I would need to tell the user to remove the CD from the drive before rebooting after installation (so that the computer doesn't boot from the CD again when it restarts)...

Please could you explain what you mean by jumping to the next sector?

Thanks :-)

 
0
 

Sure thing, floppy disks use 'sectors' to store their data, each sector is 512 bytes long. The boot loader takes up the first sector (boot loader MUST be 512 bytes in length and must end with DW 0xAA55 to tell the BIOS that it is a valid boot loader), and the next program takes up the second sector, etc. Only the boot loader has to be 512 bytes though, the rest is not limited to length.

So what the boot loader does, is load the second sector into memory(You can choose exactly where it is written by setting the ES register with the memory address.. 0x1000 etc), and then jumps to that address.. Which is where the code of your kernel would now be located, or whatever sort of code you are trying to execute. :)

But as I said, I am not sure how CDs work, I have only done this with floppy disks. Sorry.

Here's a helpful link.
And another (Int 0x13)

 
0
 

Sure thing, floppy disks use 'sectors' to store their data, each sector is 512 bytes long. The boot loader takes up the first sector (boot loader MUST be 512 bytes in length and must end with DW 0xAA55 to tell the BIOS that it is a valid boot loader), and the next program takes up the second sector, etc. Only the boot loader has to be 512 bytes though, the rest is not limited to length.

So what the boot loader does, is load the second sector into memory(You can choose exactly where it is written by setting the ES register with the memory address.. 0x1000 etc), and then jumps to that address.. Which is where the code of your kernel would now be located, or whatever sort of code you are trying to execute. :)

But as I said, I am not sure how CDs work, I have only done this with floppy disks. Sorry.

Here's a helpful link.
And another (Int 0x13)

Ah, sorry mate, I think you may have misunderstood my question.

I've already figured out how to load a second-stage bootloader into memory. Let me explain my problem a little more :-)

Say, for example, I've got BIOS's boot-order set up like the following;

1. Network
2. Floppy Disk
3. CD/DVD
4. Hard Disk

With my current bootloader, the BIOS detects my bootable installation CD and runs the bootloader, which then locates, loads and executes my second-stage bootloader (this is working). What I want to do instead, however, is first display a prompt, for example;

"Please press any key to run the installer..."

If the user doesn't press a key within a specified limit, what I want to do is jump to the next boot device (which in this case would be device 4, the Hard Disk).

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: