Skip to content

Page 1 ‐ Welcome & Boot docs

Rodmatronics edited this page Jan 24, 2024 · 5 revisions

Welcome to the CatK wiki!

Here you will find some documentation about CatK, and it's components. as well as what's to come. Keep in mind it is NOT going to always be accurate, as CatK is growing at a fast rate, and things are changing quick.

Page 1 - The Boot process

The CatK Boot process starts at GRUB. (or possibly directly at the kernel using -kernel in QEMU) GRUB prints "Cat..." then loads /boot/catkernel.bin. If the loading is successful, GRUB prints " Kernel!" (Cat.. Kernel!) and CatK boots. If unsuccessful, it prints the error after "Cat..." Such as, for example: "Cat... Error: Out of memory".

Now, we are booted! The first thing CatK does it some simple Assembly that loads the kernel's C entrypoint, "kmain". kmain displays info given by the bootloader, such as "cmdline", info on the loader, and memory info. The CatK mascot is also printed in the background of this screen. The function waits a few moments, for debugging purposes. Then shows the available memory.

Once it displays the startup info, kmain starts "boot()" and kick-starts the CatK boot process. The boot() function is quite simple...

  1. It shows the default configuration file from the kernel
  2. Gets CPU info and prints it
  3. Gets the conventional BIOS memory
  4. Allocates memory to the kernel
  5. Creates the KERNEL process
  6. Starts the VFS
  7. Starts the diagnostic services
  8. Starts SERIAL out on COM1
  9. Starts the IDT
  10. Starts the GDT
  11. Starts the TIMER
  12. Makes the /dev nodes
  13. Creates the root user
  14. Creates the ENV variables

Finally, boot() forks the shell process, and is switched to user mode.

Clone this wiki locally