Jump to content
  • Advertisement
Sign in to follow this  
Endar

Booting an OS with VMWare

This topic is 4842 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, here's the tutorial I've been following clicky and here is where I'm up to. Now, the problem is at the end of the "Printing to screen" tutorial, he says "Copy your 'kernel.bin' to your GRUB floppy disk, and if all went well, you should now have a kernel that prints 'Hello World!' on a black screen in white text!" Now, maybe someone would like to go over the tutorial up until that point, but, I'm fairly sure that he didn't say how to set up a floppy disk for GRUB. He says "copy 'kernel.bin' to your GRUB floppy disk", well, I've tried copying kernel.bin to a formatted floppy disk, which didn't work, and I tried this without actually altering the bootsector like it says, and, well, I'm here, so I'm sure you've all guessed that it didn't work again. If someone knows the answer, could you give me a nudge (or a huge shove) in the right direction? P.S. when I'm saying it didn't work, I mean that, for the first time, (formatted disk) it says "Remove disk or other media, blah, restart, blah", and then the second time, it just shows nothing. And, well, the printing code is pretty much copied and pasted, so I can't see how I could have gone wrong. P.P.S I've set the VMWare virtual machine to the "Other" operating system.

Share this post


Link to post
Share on other sites
Advertisement
After POST-test, the BIOS will load the first sector (boot sector) from your floppy disk. This sector must contain the code to start up your OS. If your OS does not fit into one sector, you will have to write code to load additional sectors. Or you can just use a boot loader like grub.

Did you check the downloads section of that site ? There are some bootloaders available.

Share this post


Link to post
Share on other sites
Quote:
Original post by Endar
P.P.S I've set the VMWare virtual machine to the "Other" operating system.


Maybe you should try Bochs.

Also read in the Grub manual about Making a GRUB bootable CD-ROM or the other chapters.

# mke2fs /dev/fd0
# mount -t ext2 /dev/fd0 /mnt
# grub-install --root-directory=/mnt fd0
# umount /mnt

[Edited by - nmi on May 11, 2005 5:28:32 AM]

Share this post


Link to post
Share on other sites
Personally, I recommend qemu as an easy alternative to Vmware or Bochs. Performance-wise, it's faster than Bochs but slower than vmware, but ease-of-use wise it's better than both.

I recommend you get some tools to make floppy disc (or CD) images. On Linux these might already be installed.

There is a program called "mtools" which can access floppy discs (DOS format) without needing the OS to mount them. It can equally access files which just happen to look like floppies.

I also recommend that you use syslinux as a bootloader (yes, it can load OSs other than Linux). It should be compatible with your .bin files.

The advantage of syslinux is that it doesn't require any special file layout on the floppy (after it is installed itself), so you can just keep copying new kernels on to the floppy and boot it without further ado.

You don't *HAVE* to use Linux as a host OS to develop your own kernel, but it probably helps :)

Mark

Share this post


Link to post
Share on other sites
Well, first off, I'm using Windows, which is kinda annoying since almost EVERYTHING is written for linux.

But, anyway, I've got it going, but I'm having a problem compiling. I've downloaded gcc for windows, everything as it describes in the tut I'm using (see above), but for two of the files, instead of compiling it just says "The system cannot execute the specified program."

Only for two files: "mem_utils.c" and "string_utils.c", and well, it prints out nothing else, so, I'm assuming that its not a compiling error, it looks like its not even starting gcc.

Here is the command line: "gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o mem_utils.o mem_utils.c"

I have never seen this before, and it is a little disheartening to have something like this happen at almost every step of the way...but that's how it is for the moment. Anyway, can anyone help?

Share this post


Link to post
Share on other sites
Do you have your PATH set correctly during the build?

Are you using Make? If so, is your Makefile written to use the appropriate Windows tools?

You might need to download a bunch of extra tools, like the MingW MSYS tools etc, so that commands like "rm", "cp" and "mv" work in your Makefile.

Alternatively, rewrite your Makefile (or build script) so that it doesn't rely on Unix-type commands.

If you want to build floppy disc images, I recommend mtools (Although I can't tell you whether it works under Windows I'm afraid).

Syslinux is an OS loader, but it requires an installation program - this installation program may have a win32 (or dos-mode) version, in which case I believe you can run it under win32, either natively from the command line or in dos-mode from the command line (in this case, make sure you don't have any long filenames or filenames with spaces in in the current working dir)

Mark

Share this post


Link to post
Share on other sites
Okay, after I compiled my code on windows and ran it in VMWare and I got a "stack overflow" or something similar error, I said "<insert unprintable here> it" and I moved to Linux (Fedora Core 3).

So, I'm now using bochs, which I haven't really run yet. I just compiled all the basic code from the website above, completely lifted off, I just want to see something before trying to do anything more complicated.

So, a whole bunch of people suggested using mtools. I have a floppy I can use, but, is it possible to run it from a file the same size as a floppy, instead of from the actual disk?

Either way, its 2:27am and I'm going to bed, so hopefully, during my unconsious hours, someone can give me a quick rundown of mtools, something to at least give me a starting point with it for when I wake up.

Or you can not, and listen to me complain when I wake up in 9 hours. :D

I appreciate all the help given so far.

Share this post


Link to post
Share on other sites
Yes you can use a disc image. Edit your ~/.mtoolsrc (or Windows equivalent, I don't know where it will be - maybe you will need cygwin and it'll be in your Cygwin home dir)

do something like this


drive q:
file="/home/mark/linuxfloppy/dosdisc.img"


Then you can do most operations normally, provided the file already exists. mformat could be more difficult though.

In theory most (if not all) of the tools should work on win32 - just a matter of setting the right paths, getting the right tools etc

Mark

Share this post


Link to post
Share on other sites
Well, using mtools, how do I write my bootsector and my kernel.bin file to a floppy?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!