mirror of
https://github.com/tailix/kernel.git
synced 2024-11-20 11:16:10 -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
|
||||
/libk/libk.a
|
||||
/modules/dummy
|
||||
/iso/image.iso
|
||||
/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 KERNEL = $(shell pwd)/arch/kernel
|
||||
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
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ run: all
|
|||
all:
|
||||
grub-file --is-x86-multiboot2 "$(KERNEL)"
|
||||
cp "$(KERNEL)" rootfs/boot/kernelmq
|
||||
cp "$(DUMMY)" rootfs/boot/dummy
|
||||
cp $(MODULES) rootfs/boot/
|
||||
grub-mkrescue rootfs -o image.iso
|
||||
|
||||
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" {
|
||||
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:
|
||||
nasm -f bin dummy.asm -o dummy
|
||||
BINS = dummy1.bin dummy2.bin
|
||||
|
||||
all: $(BINS)
|
||||
|
||||
clean:
|
||||
rm -f dummy
|
||||
rm -f $(BINS)
|
||||
|
||||
%.bin: %.asm
|
||||
nasm -f bin $< -o $@
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
[BITS 32]
|
||||
|
||||
main:
|
||||
mov eax, 512
|
||||
int 0x80
|
||||
|
||||
mov eax, 35000
|
||||
mov eax, 123
|
||||
int 0x80
|
||||
|
||||
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…
Reference in a new issue