Page 1 of 1

Development problem

Posted: Wed Dec 03, 2003 5:52 pm
by beyondsociety
For a year or so, I have been using DJGPP as my compiler suite on Windows 2000. I have currently switched over to Cygwin and like it very much. I was wondering if I still could use my previous batch file for compiling my operating system? I have a previous makefile that works on linux.

The only problems I see are: How do I copy my binary image to a floppy disk? I was originally using: mount floppy, cp to floppy. umount in linux.

Also: How would I create a image for testing in bochs? I am currently using a program called makeboot that runs from my batch file. Its syntax is: makeboot test.img bootpm.bin kernel.bin

Re:Development problem

Posted: Wed Dec 03, 2003 6:09 pm
by Curufir
It's been quite a while since I used Cygwin, but I seem to remember that it comes with a port of dd. That's what I'd use for dumping sectors onto a disk (Or image).

Re:Development problem

Posted: Thu Dec 04, 2003 2:14 am
by Pype.Clicker
another trick that works fine independently of the system is to use NASM's incbin and padding features to create one single file you'll then use with rawrite or something ...

Re:Development problem

Posted: Thu Dec 04, 2003 4:05 am
by Solar
As for writing files to floppy (i.e., using the standard file system), just do:

Code: Select all

cp <filename> /cygdrive/a/
As for dd, that's affirmative, and the way I made my first GRUB floppies. ;-)

As for the bochs image... let me quote an older posting of mine:
On http://www.acc.umu.se/~bosse/, you will find a tool named "filedisk".

Make an image from your floppy drive. (The how-to on that should be somewhere in the Bochs manuals IIRC.)

Then, you can mount that image:

filedisk /mount 0 'C:\Path\To\Your\ImageFile.img' z:

Now you can access your image at drive letter z:. Copy your kernel image there, unmount the drive with

filedisk /umount z:

...and boot the image with bochs.

Hint: I wrote a target "image" in my makefile, which builds the kernel image, and does the mount/copy/unmount. That way, all I have to do is a "make image", there you go. ;-)

Re:Development problem

Posted: Thu Dec 04, 2003 5:00 am
by Tim
Filedisk is almost brilliant.

A couple of snags:
-- You can't have a filedisk mounted while Bochs is running, and vice versa. So you need to mount, copy, unmount, Bochs every time you want to test your code.
-- It will only work on uncompressed files. A trick I use is to compress disk images so that all the zero bytes of unused space at the end aren't wasting disk space. Filedisk doesn't like this.

Re:Development problem

Posted: Thu Dec 04, 2003 7:01 am
by Curufir
Tim Robinson wrote: -- You can't have a filedisk mounted while Bochs is running, and vice versa. So you need to mount, copy, unmount, Bochs every time you want to test your code.
Huh? It works fine for me so long as I setup Bochs to use the virtual drive instead of the disk image.

Re:Development problem

Posted: Thu Dec 04, 2003 9:46 am
by Tim
OK. Maybe I was thinking of Virtual PC, which doesn't allow sharing of disk images while it's running.