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
Development problem
Re:Development problem
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).
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Development problem
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
As for writing files to floppy (i.e., using the standard file system), just do:
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:
Code: Select all
cp <filename> /cygdrive/a/
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.
Every good solution is obvious once you've found it.
Re:Development problem
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.
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
Huh? It works fine for me so long as I setup Bochs to use the virtual drive instead of the disk image.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.
Re:Development problem
OK. Maybe I was thinking of Virtual PC, which doesn't allow sharing of disk images while it's running.