Limine Bare Bones: Difference between revisions
Jump to navigation
Jump to search
[unchecked revision] | [unchecked revision] |
Content deleted Content added
No edit summary |
|||
Line 15: | Line 15: | ||
===Overview=== |
===Overview=== |
||
For this example, we will create these 2 files: |
For this example, we will create these 2 files and place them in the same directory: |
||
* |
* kernel.c |
||
* linker.ld |
* linker.ld |
||
As one may notice, there is no "entry point" assembly stub, as one is not necessary with the Limine protocol when using a language which can make use of a standard SysV x86 [[Calling Conventions|calling convention]]. |
As one may notice, there is no "entry point" assembly stub, as one is not necessary with the Limine protocol when using a language which can make use of a standard SysV x86 [[Calling Conventions|calling convention]]. |
||
Furthermore, we will download the header file '''limine.h''' which defines structures and constants that we will use to interact with the bootloader from [https://raw.githubusercontent.com/limine-bootloader/limine/trunk/limine.h here], and place it in |
Furthermore, we will download the header file '''limine.h''' which defines structures and constants that we will use to interact with the bootloader from [https://raw.githubusercontent.com/limine-bootloader/limine/trunk/limine.h here], and place it in the same directory as the other files. |
||
Obviously, this is just a bare bones example, and one should always refer to the [https://github.com/limine-bootloader/limine/blob/trunk/PROTOCOL.md Limine protocol specification] for more details and information. |
Obviously, this is just a bare bones example, and one should always refer to the [https://github.com/limine-bootloader/limine/blob/trunk/PROTOCOL.md Limine protocol specification] for more details and information. |
||
=== |
===kernel.c=== |
||
This is the kernel "main". |
This is the kernel "main". |
||
Line 213: | Line 213: | ||
# Use find to glob all *.c, *.S, and *.asm files in the directory and extract the object names. |
# Use find to glob all *.c, *.S, and *.asm files in the directory and extract the object names. |
||
override CFILES := $(shell find |
override CFILES := $(shell find . -type f -name '*.c' | grep -v 'limine/') |
||
override ASFILES := $(shell find |
override ASFILES := $(shell find . -type f -name '*.S' | grep -v 'limine/') |
||
override NASMFILES := $(shell find |
override NASMFILES := $(shell find . -type f -name '*.asm' | grep -v 'limine/') |
||
override OBJ := $(CFILES:.c=.o) $(ASFILES:.S=.o) $(NASMFILES:.asm=.o) |
override OBJ := $(CFILES:.c=.o) $(ASFILES:.S=.o) $(NASMFILES:.asm=.o) |
||
override HEADER_DEPS := $(CFILES:.c=.d) $(ASFILES:.S=.d) |
override HEADER_DEPS := $(CFILES:.c=.d) $(ASFILES:.S=.d) |