runtimejs / runtime

[not maintained] Lightweight JavaScript library operating system for the cloud
http://runtimejs.org
Apache License 2.0
1.93k stars 128 forks source link

Grub2 Can't find Multiboot header #140

Closed RossComputerGuy closed 7 years ago

RossComputerGuy commented 7 years ago

Hey, I'm using grub2 to boot runtime but Grub2 says that it can't find the multiboot header.

piranna commented 7 years ago

Do you know if runtime.js is a multiboot compliant kernel? Have you searched for the multiboot magic number? If not, it would be a good and somewhat easy addition :-)

piranna commented 7 years ago

Ok, it's multiboot compliant. So, when does your error shows up?

RossComputerGuy commented 7 years ago

when multiboot /boot/runtime is executed

piranna commented 7 years ago

Is that a command? How are you executing it?

RossComputerGuy commented 7 years ago

it is, Grub2 boot config source code:

set timeout=10
set color_highlight=black/white
set color_normal=green/black

function graphics() {
    loadfont /boot/unicode.pf2
    set gfxmode=1024x768
    set gfxpayload=keep
    terminal_output gfxterm
}

graphics()

menuentry "ModernOS" {
    loadfont /boot/unicode.pf2
    set gfxmode=1024x768
    set gfxpayload=keep
    terminal_output gfxterm
    multiboot /boot/runtime
    boot
}
piranna commented 7 years ago

How are you trying to exec it, on real hardware? Have you tried to run it on QEmu? It will be easier, you can be able to give it directly a multiboot kernel (I have done it myself in the past, also from scratch). Also, currently runtime.js only have drivers for virtio (virtual) devices...

RossComputerGuy commented 7 years ago

it works on qemu using the rom/kernel option

piranna commented 7 years ago

Ok, so seems it's an issue with Grub2. Have you tried syslinux? It's fairly easier to work with and install, in fact it's what I'm using in NodeOS.

RossComputerGuy commented 7 years ago

not yet

piranna commented 7 years ago

I would stick by the moment with the QEmu -kernel option, but if you are willing to use a bootloader, give syslinux a try ;-)

RossComputerGuy commented 7 years ago

I need help running syslinux to create a disk image from my disk directory

piranna commented 7 years ago

to create the disk image use genfatfs

RossComputerGuy commented 7 years ago

How do I get that command, I dont have it

facekapow commented 7 years ago

You could also use runtime-cli's mkimg to generate a disk:

runtime mkimg --size <how big you want it (e.g. 10G for 10 gigabytes)> --label "MODERNOS" disk.img
RossComputerGuy commented 7 years ago

I found out that Grub2 doesn't have x64 support for non-linux kernels.

RossComputerGuy commented 7 years ago

I can design a bootloader and call it Runtime.js Boot Manager

piranna commented 7 years ago

It's better to fix multiboot support on runtime.js. Example code is easy to understand, don't know why it's not working here...

El 23/6/2017 3:02 AM, "SpaceboyRoss01" notifications@github.com escribió:

I can design a bootloader and call it Runtime.js Boot Manager

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/runtimejs/runtime/issues/140#issuecomment-310542065, or mute the thread https://github.com/notifications/unsubscribe-auth/AAgfvo5tsbn65VwexDgf_LqsbWGyqeGdks5sGw6ZgaJpZM4LZ8lF .

RossComputerGuy commented 7 years ago

running readelf on the kernel outputs: readelf: Error: Not an ELF file - it has the wrong magic bytes at the start

piranna commented 7 years ago

grub accept elf kernels, but not only them... Why don't you try to compile a hello world kernel, like the example one of grub multiboot spec? It's a funny and instructive task :-)

El 23/06/2017 22:38, "SpaceboyRoss01" notifications@github.com escribió:

running readelf on the kernel outputs: readelf: Error: Not an ELF file - it has the wrong magic bytes at the start

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/runtimejs/runtime/issues/140#issuecomment-310767368, or mute the thread https://github.com/notifications/unsubscribe-auth/AAgfvmyEmZU1TWfZDBHwTtHDLGCF0ypFks5sHCIzgaJpZM4LZ8lF .

RossComputerGuy commented 7 years ago

I got it to work now

piranna commented 7 years ago

congrats! :-)

El 23/06/2017 22:42, "SpaceboyRoss01" notifications@github.com escribió:

I got it to work now

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/runtimejs/runtime/issues/140#issuecomment-310768175, or mute the thread https://github.com/notifications/unsubscribe-auth/AAgfvncDziJln-EgB4BNu0H8M08_qBDyks5sHCMqgaJpZM4LZ8lF .