ArvernOS
|
The x86_64
implementation uses GRUB as bootloader.
The GRUB configuration offers two choices: the normal mode and the kernel mode. The normal (or "default") mode will load the /bin/init
program in user mode ("ring 3"). The kernel mode will load the kshell
instead and will stay in kernel mode (as its name implies).
It is possible to change the command line by passing the CMDLINE
variable to make
(or add it to your config
file):
KERNEL_CMDLINE
, which is passed to the kernel in... kernel mode..boot
and .text
sections to memory (to addresses 0x100000
and 0x100020
)0x100020
)kmain()
function/bin/init
by defaultDuring the early boot sequence, we identity map the first gigabyte of our kernel with 512 2MiB pages. When kmain()
is called, we call paging_init()
to update the mapping:
0x00000000
to 0x000A0000
is identity mapped (present)0x000A0000
to 0x00100000
is identity mapped (present + writable)ENABLE_FRAMEBUFFER=1
is passed to make
)In addition, paging_init()
will:
0x00000000
to 0x00100000
: the first 1MiB area is reserved0x00100000
: the kernel code and data and multiboot modules0x0020xxxx
: after the end of the previous area (which is computed at runtime using the multiboot information), we allocate some space for the frame allocator0x10000000
: kernel heap area (we currently have a fixed heap size)0x40000000
: user space