Simple Kernel Loading Isse

Options
Yuan Feng
Yuan Feng New Member Posts: 5
Hi Everyone,

I wrote a simple kernel which is unix-based. How can I use upboard to boot with this OS image.

Could any one tell me the steps?

Many Thanks

Comments

  • DCleri
    DCleri Administrator, AAEON Posts: 1,213 admin
    Options
    Hi Michael,

    The question is very generic and the step may vary depending on the distribution you are using.

    Is it a Unix or Linux system?
    Does it support EFI boot?
  • Yuan Feng
    Yuan Feng New Member Posts: 5
    Options
    Hi,

    Yes, I support EFI. I put this on my thinkpad notebookt and it works. Thinkpad is sandybridge chip.

    Linux system based.
  • Yuan Feng
    Yuan Feng New Member Posts: 5
    Options
    The solution I use is

    add the following to /boot/grub/grub.cfg on ubuntu
    menuentry ' '{
    multiboot /boot/kernel....
    }

    It works on my thinkpad, but does not work on up board. It cannot display anything.
  • Yuan Feng
    Yuan Feng New Member Posts: 5
    Options
    The code I am using is similar to this
    "
    const char *str = "my first kernel";
    char *vidptr = (char*)0xb8000; //video mem begins here.
    unsigned int i = 0;
    unsigned int j = 0;

    while(j < 80 * 25 * 2) {
    /* blank character */
    vidptr[j] = ' ';
    vidptr[j+1] = 0x07;
    j = j + 2;
    }

    j = 0;

    /* this loop writes the string to video memory */
    while(str[j] != '\0') {
    vidptr = str[j];

    vidptr[i+1] = 0x07;
    ++j;
    i = i + 2;
    }
    return;
    "
  • DCleri
    DCleri Administrator, AAEON Posts: 1,213 admin
    Options
    Hi michaelyuanfeng,

    If you are compiling a custom kernel for ubuntu I would suggest to start from our kernel on launchpad: https://launchpad.net/~ubilinux/+archive/ubuntu/up

    Also, to simplify the installation of the new kernel you should try to compile with the option to create a deb package.
    You can then easily install with dpkg your new kernel from a ubuntu 14.04/16.04 system already installed in the UP board.