CDROM Boot emulates Floppy: Size?
-
- Member
- Posts: 195
- Joined: Tue Aug 26, 2008 11:24 am
- GitHub: https://github.com/sebihepp
CDROM Boot emulates Floppy: Size?
Hello everyone,
if the system boots from a CD-ROM, then it will emulating a floppy-device. But do I
have access to the hole 1440 KByte? Or is only less data accessible?
TIA Sebihepp
if the system boots from a CD-ROM, then it will emulating a floppy-device. But do I
have access to the hole 1440 KByte? Or is only less data accessible?
TIA Sebihepp
- Steve the Pirate
- Member
- Posts: 152
- Joined: Fri Dec 15, 2006 7:01 am
- Location: Brisbane, Australia
- Contact:
Re: CDROM Boot emulates Floppy: Size?
You don't have to emulate a floppy to boot from CD - far easier is to use the El Torito standard. If you use Grub, making a boot cd image (that can be booted in Bochs, QEMU etc. or burnt to a disk) is as easy as doing the following (on Linux with Grub installed):
That's taken from the install target in the makefile. Image is the directory that has the boot directory and my kernel in it. image.iso is the resulting bootable CD image.
Code: Select all
cp /usr/lib/grub/i386-pc/stage2_eltorito image/boot/grub
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -input-charset utf-8 -boot-info-table -o image.iso image
- 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: CDROM Boot emulates Floppy: Size?
If you use El-Torito emulation, then the BIOS will give you the space you told it to give you.
If you emulate a 1.4M floppy, then it will give you access to 1.4M
If you emulate a 720k floppy, then it will give you that
If you emulate a 30M harddisk, then it will give you that
If you ...
If you emulate a 1.4M floppy, then it will give you access to 1.4M
If you emulate a 720k floppy, then it will give you that
If you emulate a 30M harddisk, then it will give you that
If you ...
-
- Member
- Posts: 195
- Joined: Tue Aug 26, 2008 11:24 am
- GitHub: https://github.com/sebihepp
Re: CDROM Boot emulates Floppy: Size?
Thanks Combuster.
@Steve: I really want to use GRUB but I didn't get it work. I am using Windows Vista, cygwin and Bochs.
I don't know where to get a working image...
@Steve: I really want to use GRUB but I didn't get it work. I am using Windows Vista, cygwin and Bochs.
I don't know where to get a working image...
Re: CDROM Boot emulates Floppy: Size?
It is much simpler to use floppy/hdd emulation, as all you have to do is get a working floppy image and use your cd/dvd burn software to make the cd bootable, simply click on make bootable, point it to the floppy image, it will then add 2 bin file to the cd, click to burn and you have a bootable cd, as long as your in real mode the emulation will stay as floppy (eg any code that reads the floppy using int 13h, will read from the cd), once you go to pmode emulation stops, but if you return to real mode emulation starts again.
What could be simpler ?.
What could be simpler ?.
-
- Member
- Posts: 195
- Joined: Tue Aug 26, 2008 11:24 am
- GitHub: https://github.com/sebihepp
Re: CDROM Boot emulates Floppy: Size?
That's the way I do it right now.
Hmmm, I can't access the emulated Floppy in PMode, right? I could load the entire
floppy into memory. Very efficient.
But... why not... Only for testing ^^
Hmmm, I can't access the emulated Floppy in PMode, right? I could load the entire
floppy into memory. Very efficient.
But... why not... Only for testing ^^
Re: CDROM Boot emulates Floppy: Size?
In my OS i have two floppy drivers, one a normal pmode driver and the second a go back to real mode and back every 512bytes, this may seem slow but is not noticable slower than read/writing from pmode.sebihepp wrote:That's the way I do it right now.
Hmmm, I can't access the emulated Floppy in PMode, right? I could load the entire
floppy into memory. Very efficient.
But... why not... Only for testing ^^
This mean i can read files from the cd (under floppy emulation) just like as if it was a normal floppy.
The above also works fine for read/writing to USB fobs.
Re: CDROM Boot emulates Floppy: Size?
Hi,
I know that the RMode -> PMode -> RMode switches probably don't affect percieved speed as Dex says, but personally, I would recommend reading as much as possible from the disk for each RMode switch rather than just 512b.
My floppy reading routine reads a single sector at a time, but is wrapped in RMode and it increments the destination buffer segment in a loop, allowing the driver to read 508K per real mode switch (I use physical memory between 0x1000 and 0x80000 bytes as my buffer). Although the end user will see about the same speed for a FDD or CD, the CPU is having to do far less work and I guess could give a speed benefit with USB key drives.
Cheers,
Adam
Edit: This assumes you are able to reserve such a large low memory buffer, of course! The RMode code for this is really quite small, though, and can be either copied down to the 0x500->0x1000 location before you perform disk access, or can reside there permanently having been linked there as part of your ELF/COFF executable.
I know that the RMode -> PMode -> RMode switches probably don't affect percieved speed as Dex says, but personally, I would recommend reading as much as possible from the disk for each RMode switch rather than just 512b.
My floppy reading routine reads a single sector at a time, but is wrapped in RMode and it increments the destination buffer segment in a loop, allowing the driver to read 508K per real mode switch (I use physical memory between 0x1000 and 0x80000 bytes as my buffer). Although the end user will see about the same speed for a FDD or CD, the CPU is having to do far less work and I guess could give a speed benefit with USB key drives.
Cheers,
Adam
Edit: This assumes you are able to reserve such a large low memory buffer, of course! The RMode code for this is really quite small, though, and can be either copied down to the 0x500->0x1000 location before you perform disk access, or can reside there permanently having been linked there as part of your ELF/COFF executable.
Re: CDROM Boot emulates Floppy: Size?
I would agree with you there AJ, but it does help keep interrupts being off in pmode down to the smallest time, so its swings and round abouts.
Re: CDROM Boot emulates Floppy: Size?
Alternatively, once you are in protected mode, can't you just read the CD as if it was a CD?
Ok, you need a CD driver for that.. but still..
Ok, you need a CD driver for that.. but still..
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.