As I understand it, the zImage has a whole lot of junk to boot the kernel at the start and it is compressd, so you can't just read it and jump to it. You first have to uncompress zImage (just gunzip zImage, I forget if you have to rename zImage zImage.gz). You then must strip the kernel's boot code. I always did this in a script like: objcopy -O binary -R .note -R .comment -S vmlinux /tmp/$$-tmp-linux You then must regunzip the image in a format that your gunzip program can read: gzip -f -3 /tmp/$$-tmp-linux
You must then use some C code (like inflate.c provided with the linux kernel (which is the same inflate.c from openbios)) to inflate the image. This is kinda tricky. I do it by first copying the image in at something like 0x20000 and then uncompressing that image to 0x100000 and then jumping to 0x100000. Oh yeah; the kernel won't just boot completely, it will get to somewhere (I think the bogomips test) and die because it is missing interrupts or something like that.
You may want to start more basically by taking the zImage, uncompressing it, stripping it, and then copying the big, uncompressed image straight to 0x100000 and jumping there.
- James
On Sat, 12 Feb 2000, [iso-8859-1] Winter J�rg wrote:
James: (jvh@uclink4.berkeley.edu): Thanks for the hint on loading a Kernel, but:
Now I have a verified routine that loads the kernel (block by block) from my ATA-Disk into memory (at whatever I like. Currently at 0x00010000). I�m loading a zImage at 0x00010000, the bootsect at 0x9000, the setupsectors (4) at 0x9200. It�s just like the other loaders do it ...he?
I have the code like: static void (*v)() =(void *)KERNEL_START;
I start like: v();
and the machine (the openbios) throws me an exception 13. (general Protection Fault errorcode 0).
I tried nearly any combination of stack-location, entry-adress and kerneltype ... all fails ... I now read alot about descriptors and segments and so cause I suspect the problem is somewhere there ...
But I just dont get the point. What am I doing wrong now ?? I thought the kernel would just set up and start?
I figured out that already the jump done with the v(); is the one that causes the exception, no matter if there is a kernel or just dummy code (like: jmp $).
There must be something I misunderstood completely !! Help, I�m lost ...
greetinx, J.Winter
To unsubscribe: send mail to majordomo@freiburg.linux.de with 'unsubscribe openbios' in the body of the message
- To unsubscribe: send mail to majordomo@freiburg.linux.de with 'unsubscribe openbios' in the body of the message