More OS

Don’t you love that sense of satisfaction you get after you fix a rather annoying bug?

8 finished the VM rewrite for our kernel (and it looks *much* nicer now, and the PM can also magically keep track of free physical pages without needing an internal data structure [and hence, won’t use more memory if we ever happen to get more than 256MB of ram]) and we had a remarkably easy time integrating it into our main branch (although I’m still of the opinion that Subversion merging is horrific and painful).

Then the fun started. Things started out ok and init and idle started and the shell started and readline worked.
Then, when we tried to execute a task from the shell, things exploded.
After about an hour, I tracked down the problem to fork’s page-directory-and-table copying function… odd though, since that hadn’t changed since before the VM rewrite, and it was working fine before.
After poking at it some more, I determined that, for some unknown reason, one of the page tables in the newly-forked task contained garbage data. Garbage data that happened to look a lot like a kernel stack. Hmmm…
A bunch of breakpoints and plenty of x%cr3 4096 and psym "pcb->esp0" later, I discovered that, somehow, the same physical page was being mapped as both a kernel stack page and as a page table page. Very odd.
Poked at it for another couple hours until I managed to isolate the problem to one function… a function that destroys the current mappings in the page directory/tables to prepare a task for exec. Turns out it was a mistake with freeing pages… for some reason, the code was freeing a page *after* the desired page (PTR_ADD(page_loc, PAGE_SIZE)). Oops. Fixing that fixed the immediate bug but tripped an assertion.
That one turned out to be simpler… the wrong virtual address was being passed into the freeing function (*entry instead of entry). Whee.

So yeah, it appears that we are back in the same state that we were yesterday as far as runnability and such goes, except we have a shiny new VM that appears to be much happier (and much cleaner) than before.

I should probably go sleep, as it is 7:30… but it might make more sense to just stay up until class and then sleep afterward. Meh.

All we have left to do is finish vanish and write wait and we will be kernel code-complete (at least, theoretically… we’ll probably end up doing more rewrites and such). Awesomeness.

There has been much ITG lately. I need to get back into 11s… maybe I’ll manage to pass a 12 before I leave CMU. Wheee.
110107itg.jpg
110107itg2.jpg
110107itg3.jpg

More OS

OS is going very well.
Our thread library now passes all tests, a week early (it’s not due until next Friday). Our mutexes, condition variables, and semaphores have all been tested. Everything seems to be working. This is awesome.
We are going to make a bunch of improvements to it… for example, thr_exit() currently does not clean up its memory (we leave that work to thr_join(), which is kinda not a good idea). We also want to generally clean up and optimize our code and replace our slow linked lists with faster BSTs. Woot.

Other stuff has been awesome too. Life has been full of interviews lately with very interesting companies. Hopefully I’ll actually have a job after I graduate. This would be good.

Student Wars v2 is coming along. I’m almost done with the base set, I think. People should help me playtest sometime (this weekend?).

Work, water, Wean, and wars (of students)

Work has been awesome lately. I’ve been writing more unit tests (the fun kind), and I often find myself wishing I could work more hours on Mondays, Wednesdays, and Thursdays, and wishing that I could work fewer hours on Tuesdays. I might re-adjust my schedule to be 5 hours every day instead of the current 4/8/4/4. That would be awesome, except it would mean I work until 5 on Mondays and Wednesdays.

In case you haven’t heard (i.e. you aren’t a CMUer), a water main broke in Oakland today, leaving all of campus and most of the area around campus without water. Fairfax still had water (albeit with weakened water pressure), but Greg and I went to an all-you-can-eat Chinese buffet for dinner instead anyway, as there were notices that we shouldn’t use water unless absolutely necessary. So yeah… good times.
See here for a lovely piccar of the street exploded.

So yeah, as a result of that, they shut down the clusters (no AC without water) and server rooms, so I was left unable to really continue doing my OS project. I’m fairly confident about the idea though… so I shouldn’t be too terribly worried about the actual implementation. In any case, I have this (extended) weekend to do it, and it isn’t due until next Wednesday.
I also worked on (finished?) my first pen-based computing assignment today: a tablet PC version of tic tac toe. Unfortunately, I can’t get the program to run due to a security error. I should figure out why eventually.

I’ve been doing a lot of work on Student Wars v2 lately. After I make a few more GPA cards, some core Events, and a couple Rules, I think it will be ready for playtesting. Hopefully this will be much more balanced than Student Wars was… and not in the boring “everyone is on equal ground” kind of way, but in the “each of the four primary factions have a specific strength” kind of way. Exciting.

Life is amazing.

Photos from House Wars last week, since I haven’t posted them yet:



It’s almost 2 AM. I should probably be asleep.

Work, day 6 (and Student Wars, and masks)

Student Wars: Loose Ends has been finished and uploaded for your viewing/playing pleasure. There are probably a lot of typos, so please be kind.

Also, there are now people masks in Junk, including a Tom mask (happy, Tyler?).

Work today went decently. I finally got admin rights, and so was able to do all the installs needed to actually do my job. Huzzah! I set up and tested some peer code review programs, and hopefully they won’t break horribly. So yeah.

Wheee!

Edit:People wearing the masks!

Me as 8.

Greg as Zach.

8 as 8… backwards.