in the name of zero

March 13, 2006

foss @ zamboanga

ok, so i encountered my first kernel stump yesterday but i was able to solve it. though, quite stupidly.

i made a kernel prints() function which is actually just a wrapper around another function printc() that writes to vga memory directly, one character at at time.

to verify that i got the basic vga concepts covered, i tried to prints(”stephanie”); hoping to see steph’s lovely name getting printed. unfortunately, grub throws an error upon loading of the kernel then quits rather shamelessly. at first i thought that the emulator memory was small (64mb only) and i verified thru grub’s displaymem command that it was indeed small. enlarging it didn’t do the trick.

Error 28: Selected item cannot fit into memory

then i tried allocating a buffer from inside one of the kernel sources thinking that by doing so, it would have the correct relocation (fall inside .data).

char hername[10]="stephanie";
prints(hername);

which worked.

the problem was that i linked the kernel multiboot header with the rest of the object files without explicitly telling the linker how to handle rodata sections. by doing so, section .rodata relocates after section .comment which is another segment altogether and does not have a virtual memory address space too after the final linking. as an interim solution, i assembled the multiboot header as aout then link it with the rest of the kernel objects finally, as an elf32-i386 object.

which worked.

[ foss at zamboanga ]
lots of chick here and there. me and my friends ran errands and saw even more chicks. the more mature of the rest of the delegates seated infront with all of their achievement glory. master of this… master of that.. consistent honor student in college.. head/dean/whatever of department of X in the university of X. it was more of a pageant during the early parts. you get the idea. most of the early speakers gave rather boring speeches. pretty much just a rehash of another rehash of another rehash of the first speech (which is actually just another rehash in itself).

strictly speaking, the event wasn’t really about foss. it was about how great ubuntu is. how cool and easy it is to get ubuntu going. i have no qualms about that though but they should have changed the title to something more appropriate - ubuntu at zamboanga.

all in all, a superb effort by the organizers. not bad for a first time thing.

update: the interim “assemble header as aout and link with elf” solution was the wrong approach, said the guy i chatted with… and many kernel enthusiasts would also frown upon it… this is how it’s supposed to be done with a kernel linker sript.

Get free blog up and running in minutes with Blogsome | Theme designs available here