Where in memory does an EL-Torito bootsector end?
Where in memory does an EL-Torito bootsector end?
A regular 512-byte bootsector starts at 0x7C00 and ends at 0x7E00. But where does an EL-Torito bootsector start and end at? Since it's 2 KB long, if it also starts at 0x7C00 it would have to end at 0x8400. Is that the case?
Re: Where in memory does an EL-Torito bootsector end?
I think that wiki doesn't contain wrong things, at least in this article: http://wiki.osdev.org/El-Torito#What_Next.3FIsaac wrote:A regular 512-byte bootsector starts at 0x7C00 and ends at 0x7E00. But where does an EL-Torito bootsector start and end at? Since it's 2 KB long, if it also starts at 0x7C00 it would have to end at 0x8400. Is that the case?
You can find answers there. I can even copy some quotes here:
[ORG 0x7C00]
After you have done the 'normal' boot sector jobs, such as setting segment registers to known values and saving the contents of DL (which contains the BIOS boot drive number), you can start reading the file system, in the 2k that you have available in your boot sector.
Re: Where in memory does an EL-Torito bootsector end?
Hi,
For "no emulation" El-Torito, the firmware loads however many (virtual, 512-byte) sectors from the starting LBA address that the section entry said. Basically; it doesn't load a boot sector, it loads a "boot file" that may be 1 or more sectors (up to 0xFFFF virtual 512-byte sectors; or up to 32 MiB).
Of course on 80x86 you can't really boot a file that is larger than the memory available. For example, you could set it up as "load segment = 0x0100, number of sectors = 1264" to ask the firmware to load the boot loader from 0x00001000 to 0x0009EFFF and have a 632 KiB boot loader; but anything larger than that will probably trash the EBDA and cause problems. Note: It's possibly better to use "load segment = 0x07C0" in case the BIOS is buggy.
For "hard disk emulation" or "floppy disk emulation" El-Torito, it just emulates the hard disk and floppy disk (including the "only load a single measly 512-byte sector" thing that makes us all sad ). This also sucks for other reasons and is mostly there for crusty old OSs that don't support booting from CD at all (e.g. MS-DOS).
Cheers,
Brendan
For El-Torito; the CD has a "Boot Record Volume Descriptor" (in sector 10) that points to a "Boot Catalogue". The Boot Catalogue contains an unlimited number of entries. The firmware scans these entries to find a suitable "section entry" for the computer (e.g. same platform, and possibly other criteria like language/locale). This entry includes the starting LBA address, the number of (virtual, 512-byte) sectors, and the load segment (it doesn't have to be 0x07C0:0x0000).Isaac wrote:A regular 512-byte bootsector starts at 0x7C00 and ends at 0x7E00. But where does an EL-Torito bootsector start and end at? Since it's 2 KB long, if it also starts at 0x7C00 it would have to end at 0x8400. Is that the case?
For "no emulation" El-Torito, the firmware loads however many (virtual, 512-byte) sectors from the starting LBA address that the section entry said. Basically; it doesn't load a boot sector, it loads a "boot file" that may be 1 or more sectors (up to 0xFFFF virtual 512-byte sectors; or up to 32 MiB).
Of course on 80x86 you can't really boot a file that is larger than the memory available. For example, you could set it up as "load segment = 0x0100, number of sectors = 1264" to ask the firmware to load the boot loader from 0x00001000 to 0x0009EFFF and have a 632 KiB boot loader; but anything larger than that will probably trash the EBDA and cause problems. Note: It's possibly better to use "load segment = 0x07C0" in case the BIOS is buggy.
For "hard disk emulation" or "floppy disk emulation" El-Torito, it just emulates the hard disk and floppy disk (including the "only load a single measly 512-byte sector" thing that makes us all sad ). This also sucks for other reasons and is mostly there for crusty old OSs that don't support booting from CD at all (e.g. MS-DOS).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Where in memory does an EL-Torito bootsector end?
Hello.
This way is open and without a protection for MS DOS there are no impenetrable walls that can block it. So i think the crust of modern OSses that use the protected mode is more massive and more fully grown and in opposite to the thin dermic like a transmissible film of the MS DOS butterfly.
Dirk
But with third party software it is possible to encrust and to brighten MS DOS and to make a MS-DOS Boot-CD and/or a MS DOS USB-Stick that can boot MS-DOS from the Stick or from a CD.Brendan wrote:This also sucks for other reasons and is mostly there for crusty old OSs that don't support booting from CD at all (e.g. MS-DOS).
This way is open and without a protection for MS DOS there are no impenetrable walls that can block it. So i think the crust of modern OSses that use the protected mode is more massive and more fully grown and in opposite to the thin dermic like a transmissible film of the MS DOS butterfly.
Dirk
-
- Member
- Posts: 5590
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Where in memory does an EL-Torito bootsector end?
...Which boots using the floppy disk or hard disk emulation provided by the BIOS, since DOS is only compatible with floppy disks and hard disks.freecrac wrote:But with third party software it is possible to encrust and to brighten MS DOS and to make a MS-DOS Boot-CD and/or a MS DOS USB-Stick that can boot MS-DOS from the Stick or from a CD.
At least with El Torito, it's easy to tell the BIOS which emulation mode you want.
Re: Where in memory does an EL-Torito bootsector end?
So, how do I know what the load segment is?
Where can I find a map of how memory looks after booting from a CD-ROM?
Where can I find a map of how memory looks after booting from a CD-ROM?
Re: Where in memory does an EL-Torito bootsector end?
Isn't there an El-Torito specification that covers stuff like this?
Re: Where in memory does an EL-Torito bootsector end?
Where can I find this "El-Torito specification that covers stuff like this"?
Re: Where in memory does an EL-Torito bootsector end?
Do basic online searching, okay? Nable linked to the wiki article on El-Torito. Scroll down to external links, there are some links to what looks like specifications for El-Torito. That is probably a pretty good start. Perhaps you can find more accurate and up to date information on Google? I haven't read the specification, but I would imagine it is freely available online. Let us know if you fail to locate it, after you have actually done a real effort.
Re: Where in memory does an EL-Torito bootsector end?
Hi,
Regards,
Shikhin
You specify the load segment in the bootable ISO you generate. Depending on the tool you're using to do so, I think it should be safe to presume it's 0x07C0.Isaac wrote:So, how do I know what the load segment is?
The Wiki provides a good memory map of low memory; the only difference with booting from a CD-ROM is that the bootloader occupies the area you specify in the ISO.Isaac wrote:Where can I find a map of how memory looks after booting from a CD-ROM?
Regards,
Shikhin
Anything wrong with calling int 0x10 AH=0xe twice in a row?
I wrote a little ISO 9660 (El-Torito) bootfile. Here is the code:
It's supposed to print an "F" (stands for "First" letter) and then an "S" (stands for "Second letter"). But then I assembled it with NASM, made an image out of it using Genisoimage, ran it using QEMU and it only printed an "F"! Why?
Code: Select all
BITS 16
[org 0x7C00]
start:
mov ah,0xe
mov al,'F'
int 0x10
mov al,'S'
int 0x10
jmp $
times 2048-($-$$) db 0
Re: Anything wrong with calling int 0x10 AH=0xe twice in a r
It looks like that kind of self-exercises that are sometimes called 'homework' here. Ok, I should answer something helpful then.Isaac wrote:Why?
You initialize 'AH' before the first call but don't do it before the second. Can you refer to some specification that tells that 'int 0x10' must preserve AH or you just assumed it? Assumption is almost never a good thing, so if something isn't declared in specification it's good to be prepared for some bad cases.
Btw, I would recommend you to try built-in debugger of Bochs or QEmu. They are very nice for inspecting situations when something goes wrong.
I can also add that you don't initialize BX register, although this 0xE call uses it as an input (see http://wiki.osdev.org/RBIL -> http://www.ctyme.com/intr/rb-0106.htm).
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Where in memory does an EL-Torito bootsector end?
Start with initializing a stack before using it.
Re: Where in memory does an EL-Torito bootsector end?
I'm pretty sure that int 0x10 preserves AH. But just to make sure, I tested it out.
I got the same results; only the first letter was printed to the screen. I also tried setting up the stack:
But now it doesn't print anything. That's even worse than before! So, does anyone know the cause of the problem?
Code: Select all
BITS 16
[org 0x7C00]
start:
mov ah,0xe
mov al,'F'
int 0x10
mov ah,0xe ; this is the line I added
mov al,'S'
int 0x10
jmp $
times 2048-($-$$) db 0
Code: Select all
BITS 16
[org 0x7C00]
start:
mov bp,0x9000 ; I added these
mov sp,bp ; two lines
mov ah,0xe
mov al,'F'
int 0x10
mov al,'S'
int 0x10
jmp $
times 2048-($-$$) db 0
Re: Where in memory does an EL-Torito bootsector end?
You've initialized stack pointer but didn't set stack segment register.Isaac wrote:But now it doesn't print anything. That's even worse than before! So, does anyone know the cause of the problem?Code: Select all
BITS 16 [org 0x7C00] start: mov bp,0x9000 ; I added these mov sp,bp ; two lines
And you still didn't use debugger, did you?