Grub: Max size of kernel

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
sebihepp
Member
Member
Posts: 194
Joined: Tue Aug 26, 2008 11:24 am
GitHub: https://github.com/sebihepp

Grub: Max size of kernel

Post by sebihepp »

Hello,

what is the maximum size a kernel can have for loading with grub? On Floppy, Harddisk (FAT32) and CDRom?

Sebihepp
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Grub: Max size of kernel

Post by Brendan »

Hi,
sebihepp wrote:what is the maximum size a kernel can have for loading with grub? On Floppy, Harddisk (FAT32) and CDRom?
I doubt there is a maximum size. It would depend on the size of the disk (e.g. you can't put a 5 MiB kernel on a 1440 KiB floppy) and the amount of usable RAM in the computer; where "usable RAM" is contiguous RAM starting at 0x000100000 - anywhere from 1 MiB (if it's a very old computer with 2 MiB of RAM installed) to about 3583 MiB (if it's a computer with 3.5 GiB or more RAM and a very small "PCI hole").

Of course it's fairly common for beginners to have problems once their kernel reaches a certain size. This is because the multi-boot header needs to be within the first 8 KiB of the kernel; and beginners tend to forget to put the multi-boot header in it's own section to make sure it stays at the start of kernel (and doesn't shift out of the first 8 KiB as the kernel gets larger)... ;)


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
sebihepp
Member
Member
Posts: 194
Joined: Tue Aug 26, 2008 11:24 am
GitHub: https://github.com/sebihepp

Re: Grub: Max size of kernel

Post by sebihepp »

Thanks, then I dont't need to be worry about the size of the kernel. =)
Merdini
Member
Member
Posts: 34
Joined: Fri May 04, 2007 10:11 pm
Location: Sweden, Gothenburg

Re: Grub: Max size of kernel

Post by Merdini »

It'll just take longer time to load you kernel if it's really big.
Selenic
Member
Member
Posts: 123
Joined: Sat Jan 23, 2010 2:56 pm

Re: Grub: Max size of kernel

Post by Selenic »

WRT kernel sizes, to give a comparison: The Linux kernel can be anywhere from a bit under 1MB up to a few meg, but it's compressed (via either gzip, bzip2 or LZMA, I believe, though bz2 is discouraged (relatively slow) and LZMA is relatively new)

It really depends what the minimum you want to support is - do you want to support old computers (potentially down to 386es) or only relatively new ones with a lot of memory and a fast processor?
Post Reply