Thursday, January 28, 2010

Spring of 2010

I can't believe it's 2010. I'm excited about this semester so far. It seems like it may be less stressful than last, and my classes are finally getting interesting. I'm going to write about my progress in Operating Systems so that I can have a log to look back on what I've done and how I did it so...

Minix 3! It's an open source stripped down Unix clone we are using to understand more about what an OS is and how it works. First task, edit the main.c of the kernel, and create a patch.

First off I gave up on trying to setup network access with this, floppy is the way to go. More on that later but if you're working on this in a vmware player setup as I was, just forget about it.

Basically that means installing software is more complicated, not impossible but again that's a later thought. For now I'll use what I have and move on.

I will be making a patch so before any editing is done I need to make a backup.

mkdir /usr/src-cpy
cp /usr/src /usr/src-cpy

I edited the main.c using VI, which is setup to run only from the full command name "elvis", that was annoying to discover. And of course I prefer Nano so here is a link to a page with the basic VI editor commands. Useful if you don't use VI daily.

Next of course was the patch file done by using the "diff" command.

diff -Naur /usr/src-cpy /usr/src > 1.patch
So far so good, but now I need to be able to access that file outside of my virtual machine. The solution is fairly simple though, a virtual floppy disk. Shutdown your VM if it's online and edit it's settings. Under Hardware click Add then select floppy drive. Create a blank floppy image, name it and save it. We're not done yet though.

For minix to use that image it must be formatted and mounted. Being it is the only floppy device it is located at /dev/fd0 so:


mkdir /mnt/floppy
this will create a folder to mount the floppy to
mkfs /dev/fd0
this will format the image
mount /dev/fd0 /mnt/floppy
this will mount the image to the folder we created
Now we can copy the patch file to the floppy folder. Then retrieve it from the image later using another piece of software in our host OS capable of mounting an flp image.


No comments:

Post a Comment

Lilypie 3rd Birthday Ticker
Lilypie 4th Birthday Ticker