If I wanted to build some separate modules of code such as a kassert.c, kstring.c, kthread.c, etc. Do I build the relocatable object files the same way as I would for user applications, until the point of needing to actually creating the flat binary file during the link?
Currently, I have a loader.s and a kernel.c file that compose the entire EnigmaOS. The loader.s asm file contains stuff that makes GRUB happy and calls Kernel_Main of course. The kernel.c has Kernel_Main, Put_Char, strlen, Print_String, and Clear_Screen already
This is really cool, but I think this code is really ugly just sitting in one file. I need some Modularization!!
Kernel Linking Question
Kernel Linking Question
The More I See, The More I See There Is To See!
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: Kernel Linking Question
Yep, it's much the same until link time
Since you already have two object files (the assembler and C) it should be easy.
Since you already have two object files (the assembler and C) it should be easy.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
- xenos
- Member
- Posts: 1121
- Joined: Thu Aug 11, 2005 11:00 pm
- Libera.chat IRC: xenos1984
- Location: Tartu, Estonia
- Contact:
Re: Kernel Linking Question
There are a few differences between building object files for your kernel and building them for a user application. You need to make sure that you don't include any system headers such as stdio.h (which you would probably do for a user application) and don't use functions from any standard library. But since you already compile your kernel.c file this way, you probably already know this