http://twitter.com/jobias
XBL GamerTag: jobiasRKD
Firstly, it is damn cold in Edmonton today. -31 degrees Celsius, down to -50 with windchill. Brrrr. Cold enough so that I decided it was in my “best interests” to skip class today. Heh heh.
It also helped that public transit was paralyzed due to weather.
So I spent this morning finishing up my presentation for my protein folding over a distributed network assignment and editing my paper. A surprisingly productive start to my day. It helped that the subject was very closely tied to Folding@Home, and frankly I am easily motivated when I have an excuse to boot up my PS3 in the name of “research”.
Because I spent all morning doing this protein folding assignment, I was able to spend the whole of my afternoon working on my OS concepts assignment. I have to map the memory of the currently running process by dividing it into chunks of continguous accessibility type: read-only or read-write. It seems pretty easy when you start thinking about it, but the devil was really in the details. I spent a long time chasing down a bug that turned out to be a fundamental difference in how Linux and *BSD (and therefore my MacBook) handled virtual memory addressing. It turns out if you willy-nilly try to access memory at, say, 0x0, what would normally be a segfault in Linux (and therefore caught by my signal handler) becomes a bus error in *BSD. And since my program (as specified in the assignment) must use segfault signal catching to map the address space, my prototype as compiled on my MacBook went kaput before as it read the first page of memory!
And then there was the stupid issue of overflow; remember kids, 0xFFFFF000 + 4096 bytes (or 0x1000) equals 0x0 due to overflow, NOT 0xFFFFFFFF as I had stupidly believed. You learn something new everyday.
At least now it is able to perform simple tests of read and write accessibility. Now to mesh them together into “chunks” of contiguous accessibility type by the end of Thursday.