Showing posts with label kernel hacking. Show all posts
Showing posts with label kernel hacking. Show all posts

21 April 2008

Announcements

I have two major announcements for whoever tries to keep track of my life.

  1. I have completed the operating systems course. That's great news. Otherwise, I'd have to take it again and that would be another few months of hard work, and this time, I wouldn't learn much. Plus, that's the hardest course at this faculty. This means that if I could do it, I can do anything. Well, actually, that means I can get a bachelor's degree in CS at the end of this year (unless I screw something else up), and with all the classes I have done in advance, my master's degree will be only seven classes away.
  2. My Google Summer of Code application has been rejected. I'm a bit disappointed, but that was to be expected. Maybe next year... I'd love to work for OLPC a bit, so maybe the next GSoC would be a great opportunity. Maybe. We'll see what life brings.
Now, I can focus on completing the classes I have until June and start thinking about my next career move. And I'm learning Java.

18 March 2008

Kernel Hacking again

The second part of working on my kernel module is way harder than I thought it would be. It's the fifth day I've spent doing only this and there are still many things to fix. As for tonight, I have discovered:

  • that rw_locks are spinlocks too
  • a dozen of wrong pointers in my code
  • an undeterministic cipher based on DES
None of the above is a good thing.

Still, no matter how tough things are, I found a few spare minutes this morning to buy a new pair of earrings - does it matter that I bought four pairs last Thursday?

14 March 2008

Back to kernel hacking

I'm back to kernel hacking. The module I was writing in December has finally been graded and got a well-deserved zero. Well, it wasn't finished, so it wasn't working, so no wonder it didn't get a positive amount of points. Luckily, I have no "big" mistakes, except for an ooops that need to be investigated, but nothing is to be redesigned. It should go smoothly.

If it doesn't, I just found an evil solution: File Destructor 2.0.You just upload a file and it gives it to you back, but corrupted (so unable to be opened). Too bad I have to send my stuff as tar.gz and this format is not supported... No, seriously, I wouldn't do that. But besides the evil potential of that script, I like the idea.

19 February 2008

School goes on.

The team project meetings have been rescheduled. Me not happy. But, that means I start at 2 p.m. on Tuesdays. Actually, I'm not sure wether I should had come to the meeting yesterday or not, but I believe that if you have any doubt whether you should go to school or not, stay home.

So I spent the morning home. I did some yoga: two sun salutations. They were hard, but I know I'll get back in shape soon. I made some chicken. I cut my hair in order to look more like a decent human being rather than a coughing and coding creature (is there a point to hiding the sad truth anyway?).

I went to school. First, a networks lecture. I am interested in networks. Since today, but I am. I am interested in security so networks knowledge is important for me. Sadly, the teacher had throat problems and only gave us some general information. 15 minutes and we were free. I went to the lab and learned some Java.

Then came my favourite subject, error correcting codes. It's the continuation of last semester's class, focused on cyclic codes. I liked the linear block codes lecture a lot and got 90% at the final exam, so it's no wonder I went for the cyclic codes as well. Huge was my disappointement when the lecture turned out to be another algebra revision! It was hard to take in the first semester, as every single student knew everything already, but twice? Why? What was I supposed to do? Turned my laptop on and played The Sims.

The next class was an introduction to LaTeX. I played Need for Speed on Xbox at my boyfriend's place.

That was a nice day. But today isn't bad either, as I went to the networks lab and was done with school for this week at noon! Now I have the whole rest of the week for quality time with operating systems (which means I'll be busy and won't be blogging my best, sorry about that).

18 February 2008

First day of school

Hello from school on the first day of the new semester.

Don't be fooled - the old one isn't exactly over yet. I am still waiting for my scores of the operating systems lab. Once you get your score, you can fix your code and send it again and get 75% of the poins. We have time untill next monday. Sure, my group will have a bit longer, as we would have to fix two assignements in a week, wich would be cruel, still, I'm not happy. I can't wait to be done with it.

Anyway, as you can see from my schedule, today is Artificial Intelligence day. First, a lecture. I overslept (as planned, the lecture notes are avaliable on-line).

10a.m., a lab. Now here's something I love about my school:

"So, I assume everyone here knows Java."

Yeah. Let's take a look at our program. First, you have "introduction to programming" and "programming methods" in Pascal. Then "object oriented programming" in SmallTalk with a bit of C++. Then "concurrent programing" and then "operating systems", both in Ansi C. Anyone sees Java on the list? (Anyone sees something that I could use in real life or that could get me a job?)

I'm learning Java.

(In parallel, there's the team project we'll be writing this semester (during the first semester we just did the documentation), in Java. We're supposed to meet on Tuesdays but the teacher is trying to reschedule it on Thursday or Fridays, violating my holy right to a 4-day week-end. Gotta fight for my right!)

Back to my day. Right now, free time, which I used to get a lunch and now I'm back at the lab (gotta learn Java). Then AI class at 2 p.m. Then groceries shopping and studying home. I let my Brother use my laptop for a presentation and I'll have it back in the evening. I wonder how I'll survive my first afternoon without it.

Can anyone recommend a good Java tutorial?

06 February 2008

What the geek is doing

You might be wondering what I'm doing when I'm not working on my operating systems lab projects. Well, I am studying for my operating systems exam. I set up a personal wiki for that purpose with Wiki on a Stick. By the way, I learned a bit of the wiki syntax, so I will most probably make a good use of it soon.

I am so looking forward for this semester to be over. The operating systems are a real pain-in-the-brain (and a legend in my school). All I wish for right now is pass. They're not my biggest passion, they don't inspire me to anything (ever wondered why there is no post here starting with "hey guys, did you know that the slab allocator..."?). How I long for some high-level programming... And some "code what you want" programming... I fortunately will have those next semester.

So the exam is tomorrow. On Friday, there's the correcting codes exam. I'll start studying revising after the OS. Today is Ash Wednesday. Fasting when you're supposed to study as hard as you can is not cool. (Okay, fasting is not supposed to be cool, by definition.) There's no milk and I can't stand coffee without it... poor little me studying computer science, forced by... er... wait... That's it! I can quit, not have to study OS and have time to buy milk! Still, there's a reason I'm much better off the way things are (better by far).

21 January 2008

4:51 a.m. on a Monday

It's 4:51 a.m. ... My Dad is going wake up soon. Then my brothers. I hope I will be in bed by then.
It's dark and quiet, but I'm listening to loud music not to fall asleep. My back hurts. So do my wrists. They never did, but there is a start to everything.
Most importantly, my kernel patch is ready. I just have to do some testing and I can go to bed.

I'm gonna sleep as hard as I can with my new friend Insomnia. And then I don't know what I'm gonna do. Not much anyway. I just stole this day and used it tonight to complete my project.

18 January 2008

Geek goes to school

I went to school yesterday. That's a big event now, last time I set foot there was 8 days earlier (and only for two hours). It was cool, I got a nice break from kernel hacking. Instead, I was chillin' with the guys (I had semantics and operating systems and I'm the only girl in both classes) and talking about partying and movies and games... Nah, I'm fooling you. What do you honestly think we were talking about?

I learned a few useful things at school, like the fact that the number of major page faults is indeed in the task_struct (click here for exclusive information!) and that the semantics teacher still doesn't want to teach us about program verification. Why would he? The verification assignement was due that day and everyone did it somehow. Oh yeah, and I learned how to do the verification assignement on a short trip to the computer lab and did it too. See kids how useful going to school is?

Going to school has also some major disadvantages. My coffee milk got kindly donated to Fifa. Two classes strategically planned can take the whole day (2-6p.m. but I had to get there two hours earlier to do some administrative stuff, getting there takes an hour...) and I'm still tired. Still, it was a nice break from kernel hacking, but now I'm back to it.

15 January 2008

You know you do it too much (again!) when...

These days, I'm only sitting at home, mainly browsing http://lxr.linux.no/linux+v2.6.17.13/ in order to find out how to write my prefetching kernel patch and typing a bit. Anyway, kernel hacking all the time.
All the time is too much. It's not right. It's not sane. And you know it when you feel the urge to try this:

/usr/bin/time halt
(The first command measures how long the second one is execuded, and the second one shuts the system down.)
Here's the result:
Broadcast message from root@ubuntu
(/dev/pts/0) at 14:29 ...

The system is going down for halt NOW!
0.00user 0.00system 0:00.05elapsed 16%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (2major+379minor)pagefaults 0swaps
Well, I guess this means /usr/bin/time behaves right when it gets a kill signal. But what does it say about my behaviour? (I don't think I wanna know...)

12 January 2008

Geek busy again

I'm really busy again and I'm afraid you won't see much relevant content anytime soon here.
This time, I'm working on a kernel patch that does some prefetching. I hope I'll finish this assignment in time and won't have to fix it in March. It's due next Monday and I'm already tired. It's no good when you find solitaire interesting. It's much worse when you wanna switch places with Britney Spears because she doesn't have the operating systems class. I know she's double-divorced, her kids have been taken from her, photographers follow her all the time, she's addicted to smoking, she has family issues, her mental health is questionable, but at the moment, I claim she doesn't know her luck.
Wait, didn't I say I was happy, I wanted this myself and stuff? I still do, but the end of the semester is coming and I'm really tired of it, and my health issues (which I didn't exactly ask for and don't make me as happy as compiling the Linux kernel) don't really help.

13 December 2007

How is my module going

Like a handicapped snail nailed to a wall.
Hmm, 'snail' and 'nail' rhyme in English... Sounds like song material to me!

11 December 2007

Busy geek.

Not much to read for you guys this week, sorry. I'm working hard on my kernel module, at the moment I'm reading chapter 3 from this book and adjusting the code to my needs.
Besides that, I wrote a song, which I hadn't done for a few months, and it went smoothly. (Well, I was supposed to be writing documentation for the team project... but I did both in the end.) How good can a song called "Every day is headache day" be? Well, it's not the most brilliant song ever, still I am happy with it.

09 December 2007

Givin'up on UML

The last week was a nightmare. Well, no one ever said it was gonna be easy. On the contrary, the operating systems lab is a legend. Anyway...
I spent quite a few days setting-up User Mode Linux. Compiled it, ran it, made and even better filesystem with a fresh and Ubuntu-suited script. The network didn't work. I spent a day trying to set it up. Nothing. I said "okay, I can live without mc, althrough I really like the built-in text editor as I don't have much experience with Vim or Emachs". Fine. Then make didn't work. One more day setting up the network, as successful as the previous one. I said "okay, I can live without make, I can compile on Linux1 (my machine on VmWare) then copy it onto Linux4" (the third attepmt to UML - don't ask wether I count from 0 or from 1). Fine. Modules didn't work.
This was time for a good lets'-burst-into-tears crisis. One week to deadline and I don't know how much trouble is UML gonna cause. So my boyfriend and I decided to give it up - I would mess with Linux1's kernel. He gave me access to the VmWare console so I could take snapshots and clean my mess.
Fine. Donwloaded a vanilla kernel. Compiled it (you gotta edit the Makefile a bit to compile 2.6.17-13 under Ubuntu, easy to find). Edited Grub and tried to run it. Once. Once again. And again. And again. And again.
And let's burts into tears again.
My boyfriend changes the hard drive on VmWare from SCSI to IDE. I reinstalled Ubuntu. He came over. Half an hour and it worked!
Man, when I think we could have just started off that way... One week to deadline and I haven't started writing the module. I just wasted an entire week.
Okay, gotta be strong now and type as hard as I can.

03 December 2007

User Mode Linux

I just got it working. Took me longer than it should, but the important thing is, it works.
So, if you wanna avoid my mistakes, here's what to do:

  1. Before compiling the kernel, konfigure it properly, as outlined on http://cosi.clarkson.edu/docs/kernel/setup/uml/uml.html
  2. If you encounter compiling problems, believe there's a way and google for it (see my previous post for 2.6.17-related issues).
  3. Don't waste time on creating and configuring your own filesystem on Ubuntu 7.10, because the one for 7.04 works.
I'm really gaining a lot of experience here.

01 December 2007

User Mode Linux with kernel 2.6.17.13

I DID IT!!! I compiled the 2.6.17.13 kernel for UML (make ARCH=um), on Ubuntu 7.10 Server (I think), vanilla style (no patches). "make ARCH=um" is not as simple as it seems, I had some errors, but finally managed to compile it (I didn't say "run it"). Here's what went bad:

arch/um/sys-i386/user-offsets.c:19: warning: implicit declaration of function offsetof
arch/um/sys-i386/user-offsets.c error: expected expression before struct
Solution:
http://www.mail-archive.com/.../msg225786.html

I don't remember the second mistake, but such a simple thing helped:
In arch/um/sys-i386/user-offsets.c, change #include <linux/stddef.h> to #include <stddef.h>
It was said on:
http://courses.ece.uiuc.edu/ece435/Labs/lab2a.pdf
http://readlist.com/lists/vger.kernel.org/linux-kernel/54/273734.html

arch/um/include/kern_util.h:9:27: error: linux/threads.h: No such file or directory
Solution:
http://readlist.com/lists/vger.kernel.org/linux-kernel/54/274755.html

arch/um/os-Linux/aio.c:83: error: unknown field aio_reserved3 specified in initializer
Solution:
https://bugs.launchpad.net/ubuntu/+source/.../+bug/163011

arch/um/os-Linux/process.c:275: error: expected =, ,, ;, asm or __attribute__ before { token
arch/um/os-Linux/process.c:144: error: parameter name omitted
arch/um/os-Linux/process.c:285: error: expected { at end of input
Solution:
http://www.uwsg.iu.edu/hypermail/linux/kernel/0609.2/1113.html
or (not tested, but they say it also works)
http://www.uwsg.iu.edu/hypermail/linux/kernel/0609.2/1061.html

arch/um/os-Linux/sys-i386/registers.c:139: error: JB_BP undeclared (first use in this function)
Apply this patch: http://user-mode-linux.sourceforge.net/.../2.6.17/patches/jmpbuf

You know you do it too much when...

I was going to bed yesterday. My other cat, Linux, was lying on the bed. And I said to myself:

"This is Linux in guest mode and I am the host."

Adventures in kernel hacking

My operating systems class is a real pain in the brain. I spent the entire day yesterday trynig to compile anything. My dream goal was to add the "Hello, World'" module to the Linux kernel. It's still a pretty remote goal.
I had already spent a few days tryinhg to compile the 2.6.17.13 kernel on Ubuntu 7.10 on my VmWare. First, there was a bug. Fixed it. Then it couldn't finish because the drive was full (and i started off with 5 gigs free!). Gave up.
Moved on to a VmWare on my boyfriend's server. Debian. Compiled kernel. Didn't boot (probably cause I screwed the disk drivers). BF fixed but told me to get UML because of all the screwing opportunities. 2.6.17.13 won't compile with "ARCH=um".
Went to bed at 23h.
I started this day a lot nicer. An episode of "Project Runway". Talking to my parents. Tea, tea, tea, and more tea (my throat is always dry). Yoga and abs training. Then I did what women do best: spent half an hour in the bathroom using a dozen of different products.
Now it's time for one more cup of tea (or maybe coffee? no one sane compiles the linux kernel without coffee!) and googling about that 2.6.17.13-based UML.