Re: "How to configure Grub?" and "bash: ./kernel.bin: cannot execute binary file"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday 01 February 2009 15:02:49 Won De Erick wrote:
> Hello All,
>
> I am following a tutorial from the following link, but I am stuck at the
> bottom of the page.
>
> http://www.osdever.net/bkerndev/Docs/printing.htm

As a sidenote, things *have* happened in the kernel during the last 4 years.

>
> "Copy your 'kernel.bin' to your GRUB floppy disk, and if all went well, you
> should now have a kernel that prints 'Hello World!' on a black screen in
> white text!"

Hum? Are you creating a bootable disk? Then I guess you have to edit the MBR 
on that disk as well. I haven't created boot-disks in ages, not since PC's got 
the ability to boot from a CD ;)

What about something like this:
sudo grub-install /dev/floppy

Assuming you have mounted your floppy at /dev/floppy, otherwise, I guess 
/dev/fd0 [w|c]ould work. This is, ofcourse, *totally* untested ;)

Then you obviously need to set the floppy as the first boot-device in the bios 
of your target and boot with the floppy in.

> I am completely a newbie on this area, and have no idea how to configure
> GRUB to load the kernel.

As others, said, manually edit /boot/grub/menu.lst or name it vmlinuz-
your_version in /boot and run

sudo update-grub

> I've been googling the web, but most of them suggest for the creation of a
> boot floppy disk with GRUB. I don't have that drive on my laptop.
>
> I am using Ubuntu Linux installed on a VMware 6.5.1. My laptop is Compaq
> Presario AMD Athlon-X2.
>
> # uname -a
> Linux pc-vm3 2.6.27-9-generic #1 SMP Thu Nov 20 22:15:32 UTC 2008 x86_64
> GNU/Linux
>
> Could i run this as a simple a.out? I am getting the following error:
>
> # chmod +x kernel.bin
> # ./kernel.bin
> bash: ./kernel.bin: cannot execute binary file

You cannot do that. the kernel is *the* kernel, not an elf-image you can 
execute. It contains everything other programs rely upon the kernel to 
provide, and, furthermore, it requires to be run in priviliged mode, something 
user-space programs are not allowed to do.

You moost *boot* into this program.

> Is there any wrong in the code? See attached zip file.

which file? Anyway, you have other errors you need to fix before this becomes 
relevant anyway. 

>
> Thanks,
>
> Won
>
>
>
>
>
>
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ

-- 
Med vennlig hilsen - Yours Sincerely
Henrik Austad

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux