Git Product home page Git Product logo

mkernel's Introduction

mkernel

This is a minimalist kernel which prints "my first kernel" on the screen and then hangs.

  • The kernel is multi-boot compliant and loads with GRUB.

Blog post

Kernel 101 – Let’s write a Kernel

Build commands

nasm -f elf32 kernel.asm -o kasm.o
gcc -m32 -c kernel.c -o kc.o
ld -m elf_i386 -T link.ld -o kernel kasm.o kc.o

Test on emulator

qemu-system-i386 -kernel kernel

Get to boot

GRUB requires your kernel executable to be of the pattern kernel-<version>.

So, rename the kernel:

mv kernel kernel-701

Copy it to your boot partition (assuming you are superuser):

cp kernel-701 /boot/kernel-701

Configure your grub/grub2 similar to what is given in _grub_grub2_config folder.

Reboot.

Voila!

kernel screenshot

The next step

See mkeykernel repo

mkernel's People

Contributors

arjun024 avatar bryant1410 avatar idontknowwhatiam avatar johnlunney avatar sbennett1990 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mkernel's Issues

Adding grub entry in 0.97

How should I add entry to grub 0.97
I have created VM and installed Ubuntu 12.04
I have also compiled kernel file and moved in to /boot directory
I edited file /etc/default/grub by adding an entry

title myKernel
    root (hd0,0)
    kernel /boot/kernel-701 ro

After this I try to update grub #sudo update-grub
But I got error saying title command not found.
What am I missing here?

No mitigation against Meltdown attack

mkernel doesn't unmap vulnerable memory pages from userspace, which makes it vulnerable to the Meltdown attack on Intel CPUs. I advise against using it for critical cloud services as long as this issue remains.

Invalid magic number

Hi,
I am using Ubuntu 14.04.
I followed the steps on your blog, added an entry to grub.cfg like this

menuentry 'My Kernel' { 
   set root='hd0,msdos1'
   #my kernel executable is kernel-101, I even tried simply /kernel-101 btw
   multiboot /boot/kernel-101 ro
}

And I updated my grub with
sudo update-grub

And when I restart, it throws me
error: invalid magic number

What could be the problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.