OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 7:27 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Create a Floppy Disk Image with VBScript
PostPosted: Sun Jul 17, 2011 2:37 pm 
Offline

Joined: Sun Jul 17, 2011 1:42 pm
Posts: 2
I just finished writing a VB script that can create a floppy image ready to be either written to a floppy using RawWrite or selected by Bochs. I expect that other people might find this useful if they are developing under Windows and plan on using GRUB to load their kernel.

The floppy image is formatted in FAT12 and GRUB is optionally loaded into the boot sector to boot your kernel. Once formatted, files are recursively copied from the "contents" directory of the CWD (directory that you ran the script from) onto the floppy image.

I've attached the script as a text file so that you don't accidentally run it upon download. Be sure to read the comments I wrote at the top of the script for its intended usage. I've tried to make it easy to configure. Rename its file extension to VBS in order to execute it. Below is the layout of my working directory for this script. I simply double-click the script to execute it.

contents\
->boot\
-->kernel.bin ; My kernel
-->grub\
--->menu.lst ; title My Kernel ; root (fd0) ; kernel /boot/kernel.bin
--->stage1 ; GRUB stage1
--->stage2 ; GRUB stage2
grubdir\
->stage1 ; GRUB stage1
->stage2 ; GRUB stage2
floppyimage.vbs

Notes:
I got GRUB stage1 and stage2 precompiled from ftp://alpha.gnu.org/gnu/grub/. I have not tried GRUB 2 with this, just GRUB 0.97-i386-pc.
I'm aware that the file times are incorrectly set. I haven't bothered looking into why this is so and I figure its not too important.
I've tried to keep the script clean and commented, but by no means is it efficient. Floppy images that this script creates are small (1.44MB max) and they typically take less than a minute to make.

I'm new to this site so if I'm posting on the wrong board, not following stated procedures, or offending anyone then please educate me. I'm not familiar with posting on boards and will not be offended if I am corrected.

Feel free to comment or make suggestions.


Attachments:
File comment: Rename extension from TXT to VBS
floppyimage.txt [15.39 KiB]
Downloaded 96 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot] and 87 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group