Page 1 of 1
Writing to alternate sectors on CD?
Posted: Sun Nov 18, 2007 6:39 pm
by Robin4286
I have a few questions regarding OS development that really have me stuck right now:
1. So say I have 2 seperate pieces of assembly code, how Can I write one to one sector of a cd (not a floppy, I don't have a floppy drive), and one to another?
2. I do not want to use grub, or any premade bootloaders, but all of the tutorials I have read on how to write my own seem to either not give any examples, or give one massive example with tons of extra features that are overcomplicated. How, in the very most basic form, can I run a second sector on a cd (like the one made above) without any error handling or extra features?
I am new to OS coding, so it would be nice If I could get some help with these.
Thanks!
Posted: Sun Nov 18, 2007 7:27 pm
by bewing
Hmmmm. Well, I've written up a nice tutorial on how to make a bootloader and/or an MBR -- but it's mostly for booting hard drive (& floppy) kernels. Booting a CD is tricky. And developing an OS on a CD is like doing a NY Times Sunday crossword puzzle in pen, times a million -- unless this is a RW CD?
I'd have to recommend getting a debug version of Bochs (at sourceforge, perhaps), building a hard disk image on your main drive (that part is really easy), and maybe using Norton Diskedit (it's in any Norton Utilities package) to write info to that disk image. My tutorial would help at that point -- I could email it.
Posted: Sun Nov 18, 2007 7:41 pm
by Robin4286
I use a CD RW(actually a couple to speed things up), and I have a laptop sitting right next to me that I would rather use for testing, as I can look at my code and test at the same time (and I can also be sure that if something odd happens, its not the emulator).
It would be great if you could email me the tutorial as well! ( my email is
[email protected])
Oh and, Is there another way besides Norton utilities? (Is Norton Utilities free?)
Thanks!
Posted: Sun Nov 18, 2007 10:14 pm
by LordMage
check out magic ISO, it is shareware with a trial but you can create CD images up to a certain size which should be fine until you get pretty far into your OS design. It also has the beautiful ability to make a bootable CD based on a floppy image.
Posted: Sun Nov 18, 2007 11:52 pm
by Steve the Pirate
Why don't you want to use GRUB? I use it for my OS, and it makes booting from CD dead easy.
My makefile makes an iso that I test in Virtualbox (or Bochs if I need to debug). I haven't actually burnt it to a CD yet - I can test it on real hardware by copying it into a folder in /boot.
Posted: Mon Nov 19, 2007 1:23 am
by Combuster
You can use your own bootloader in conjunction with the
Bootable CD tutorial. The input is however a bootable floppy image.
Posted: Mon Nov 19, 2007 1:04 pm
by Dex
The easiest way to boot from a CD is to use a bootable floppy image or hdd image, without a floppy drive, you will need a program that can making floppy image without a floppy, than you can add your program and bootloader to it.
Most cd burn software includes in the menu, a "make CD bootable", click on it and point it to your floppy image, that's it the cd will be bootable.
Note: When you boot from it, it will emulate a floppy and you can load the file with int 13h, but as soon as you move to PMode emulaton will stop.
Also this may help:
http://board.flatassembler.net/topic.php?t=4415