Creating kernel.img

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Post Reply
art6050
Posts: 2
Joined: Mon Feb 01, 2016 3:40 pm

Creating kernel.img

Post by art6050 »

Hi,

I am trying to build new OS for raspberry according to http://wiki.osdev.org/Raspberry_Pi_Bare_Bones. I did steps until "Booting the kernel" section, I cannot understand what to do.
So now we replace the original kernel.img with our own, umount, sync, stick the SD card into RPi and turn the power on
How can I create my own kernel.img file or where can I find it ?
User avatar
Nutterts
Member
Member
Posts: 159
Joined: Wed Aug 05, 2015 5:33 pm
Libera.chat IRC: Nutterts
Location: Drenthe, Netherlands

Re: Creating kernel.img

Post by Nutterts »

If you'd read the tutorial you'd know that kernel.img is what you get after compiling the assembler and C example in it and linking them together. Please read this: http://wiki.osdev.org/Required_Knowledge

The RPi isn't something you'd want to do if you've never tried writing a kernel for i686. First off the documentation for the RPi hardware is sparse and partially wrong. You'll have to figure almost everything out yourself with little to no help. i686 is very well documented with tons of examples and people who could give advice about it in they're sleep.

That said, you'll have quite some RPi example code here: https://github.com/dwelch67/raspberrypi

Something to also keep in mind is that models do not all work the same. The memory mapped peripherals might be at a different address. Also the RPi 2B uses a whole different processor. For the RPi 2B you could look at my old code and take what you need: https://bitbucket.org/nutterts/linloader/src

Edit: If you haven't figured it out in the meantime... rename myos.bin to kernel.img. But trust me, if you can't figure that out by yourself then you shouldn't write a kernel for the RPi. You need to have great problem solving skills.
"Always code as if the guy who ends up maintaining it will be a violent psychopath who knows where you live." - John F. Woods

Failed project: GoOS - https://github.com/nutterts/GoOS
Post Reply