Writing to alternate sectors on CD?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Robin4286
Posts: 2
Joined: Sun Nov 18, 2007 6:25 pm

Writing to alternate sectors on CD?

Post 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!
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Post 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.
Robin4286
Posts: 2
Joined: Sun Nov 18, 2007 6:25 pm

Post 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!
LordMage
Member
Member
Posts: 115
Joined: Sat Sep 22, 2007 7:26 am
Contact:

Post 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.
Getting back in the game.
User avatar
Steve the Pirate
Member
Member
Posts: 152
Joined: Fri Dec 15, 2006 7:01 am
Location: Brisbane, Australia
Contact:

Post 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.
My Site | My Blog
Symmetry - My operating system.
User avatar
Combuster
Member
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:

Post by Combuster »

You can use your own bootloader in conjunction with the Bootable CD tutorial. The input is however a bootable floppy image.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post 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
Post Reply