Friday, January 29, 2010

First Assignment in Minix

Today school let out early so I was able to stay after class and talk to Dr. Lu. Fortunately for me he had been working on the virtual machine for minix. Unfortunately when we sat down in the lab it didn't work. After some quick changes to the vm player we had a working setup and ftp access so it was possible to submit our patches.

I'm not sure if this was the same trouble I ran into last night but it's possible. I had the network setup as bridged but couldn't download software so was unable to get ftp setup. Today though we had to switch it from NAT to bridged. Dr. Lu doubled checked and found that it had to be be NAT in the main labs, but bridged in the small test lab we were using down in the CS Dept.

Seems like there is no reason for this but now we know and can keep everyone else from getting frustrated.

Well now that that's done I can focus on writing my first shell for minix.

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.


Lilypie 3rd Birthday Ticker
Lilypie 4th Birthday Ticker