mirror of
https://github.com/tailix/kernel.git
synced 2025-02-10 15:36:37 -05:00
Add two dummy modules
This commit is contained in:
parent
e7401dcc67
commit
2173d144b1
7 changed files with 25 additions and 13 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -5,7 +5,5 @@
|
||||||
|
|
||||||
/arch/kernel
|
/arch/kernel
|
||||||
/libk/libk.a
|
/libk/libk.a
|
||||||
/modules/dummy
|
|
||||||
/iso/image.iso
|
/iso/image.iso
|
||||||
/iso/rootfs/boot/kernelmq
|
/iso/rootfs/boot/kernelmq
|
||||||
/iso/rootfs/boot/dummy
|
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -3,7 +3,7 @@ include config.mk
|
||||||
export INCLUDE = $(shell pwd)/include
|
export INCLUDE = $(shell pwd)/include
|
||||||
export KERNEL = $(shell pwd)/arch/kernel
|
export KERNEL = $(shell pwd)/arch/kernel
|
||||||
export LIBK = $(shell pwd)/libk/libk.a
|
export LIBK = $(shell pwd)/libk/libk.a
|
||||||
export DUMMY = $(shell pwd)/modules/dummy
|
export MODULES = $(addprefix $(shell pwd)/modules/, dummy1.bin dummy2.bin)
|
||||||
|
|
||||||
run: run-iso
|
run: run-iso
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ run: all
|
||||||
all:
|
all:
|
||||||
grub-file --is-x86-multiboot2 "$(KERNEL)"
|
grub-file --is-x86-multiboot2 "$(KERNEL)"
|
||||||
cp "$(KERNEL)" rootfs/boot/kernelmq
|
cp "$(KERNEL)" rootfs/boot/kernelmq
|
||||||
cp "$(DUMMY)" rootfs/boot/dummy
|
cp $(MODULES) rootfs/boot/
|
||||||
grub-mkrescue rootfs -o image.iso
|
grub-mkrescue rootfs -o image.iso
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f image.iso rootfs/boot/kernelmq rootfs/boot/dummy
|
rm -f image.iso rootfs/boot/kernelmq rootfs/boot/*.bin
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
menuentry "KernelMQ" {
|
menuentry "KernelMQ" {
|
||||||
multiboot2 /boot/kernelmq hello kernel
|
multiboot2 /boot/kernelmq hello kernel
|
||||||
module2 /boot/dummy qwe rty
|
|
||||||
|
module2 /boot/dummy1.bin foo bar
|
||||||
|
module2 /boot/dummy2.bin car cdr
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
all:
|
BINS = dummy1.bin dummy2.bin
|
||||||
nasm -f bin dummy.asm -o dummy
|
|
||||||
|
all: $(BINS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f dummy
|
rm -f $(BINS)
|
||||||
|
|
||||||
|
%.bin: %.asm
|
||||||
|
nasm -f bin $< -o $@
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
[BITS 32]
|
[BITS 32]
|
||||||
|
|
||||||
main:
|
main:
|
||||||
mov eax, 512
|
mov eax, 123
|
||||||
int 0x80
|
|
||||||
|
|
||||||
mov eax, 35000
|
|
||||||
int 0x80
|
int 0x80
|
||||||
|
|
||||||
mov eax, 0 ; exit
|
mov eax, 0 ; exit
|
11
modules/dummy2.asm
Normal file
11
modules/dummy2.asm
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[BITS 32]
|
||||||
|
|
||||||
|
main:
|
||||||
|
mov eax, 456
|
||||||
|
int 0x80
|
||||||
|
|
||||||
|
mov eax, 0 ; exit
|
||||||
|
mov ebx, 0 ; error code
|
||||||
|
int 0x80
|
||||||
|
|
||||||
|
ret
|
Loading…
Add table
Reference in a new issue