mirror of
https://github.com/Tom-on64/kern.git
synced 2026-11-03 18:22:22 +00:00
Added an editor program. It doesn't edit anything yet :/
This commit is contained in:
@@ -8,7 +8,7 @@ CFLAGS = -std=c17 -ffreestanding -fno-builtin -fno-stack-protector -fno-pie \
|
|||||||
|
|
||||||
SRC = ./src
|
SRC = ./src
|
||||||
BUILD = ./build
|
BUILD = ./build
|
||||||
C_FILES = calc
|
C_FILES = calc editor
|
||||||
FONTS = testfont term16n
|
FONTS = testfont term16n
|
||||||
|
|
||||||
.PHONY: os clean run
|
.PHONY: os clean run
|
||||||
@@ -30,6 +30,7 @@ filesystem: bootloader kernel $(C_FILES) $(FONTS)
|
|||||||
@dd if=$(BUILD)/testfont.bin of=kern.iso bs=512 seek=60 conv=notrunc status=none
|
@dd if=$(BUILD)/testfont.bin of=kern.iso bs=512 seek=60 conv=notrunc status=none
|
||||||
@dd if=$(SRC)/fs/test.txt of=kern.iso bs=512 seek=64 conv=notrunc status=none
|
@dd if=$(SRC)/fs/test.txt of=kern.iso bs=512 seek=64 conv=notrunc status=none
|
||||||
@dd if=$(BUILD)/calc.bin of=kern.iso bs=512 seek=65 conv=notrunc status=none
|
@dd if=$(BUILD)/calc.bin of=kern.iso bs=512 seek=65 conv=notrunc status=none
|
||||||
|
@dd if=$(BUILD)/editor.bin of=kern.iso bs=512 seek=71 conv=notrunc status=none
|
||||||
|
|
||||||
$(BUILD):
|
$(BUILD):
|
||||||
@[ -d $(BUILD) ] || mkdir $(BUILD)
|
@[ -d $(BUILD) ] || mkdir $(BUILD)
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
__attribute__ ((section("entry")))
|
||||||
|
int main(int argc, char** argv) {
|
||||||
|
if (argc < 2) {
|
||||||
|
printf("Usage: %s <file>\n", argv[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%s\n", argv[1]);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
SECTIONS {
|
||||||
|
.text 0x400000 : {
|
||||||
|
*(entry);
|
||||||
|
*(.text*);
|
||||||
|
}
|
||||||
|
.data : {
|
||||||
|
*(.data*);
|
||||||
|
}
|
||||||
|
.rodata : {
|
||||||
|
*(.rodata*);
|
||||||
|
}
|
||||||
|
.bss : {
|
||||||
|
*(.bss*);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -19,6 +19,7 @@ filetable:
|
|||||||
db "testfont",0,0, "fnt",0,60,4
|
db "testfont",0,0, "fnt",0,60,4
|
||||||
db "test",0,0,0,0,0,0, "txt",0,64,1
|
db "test",0,0,0,0,0,0, "txt",0,64,1
|
||||||
db "calc",0,0,0,0,0,0, "bin",0,65,6
|
db "calc",0,0,0,0,0,0, "bin",0,65,6
|
||||||
|
db "editor",0,0,0,0, "bin",0,71,10
|
||||||
|
|
||||||
times 512-($-$$) db 0
|
times 512-($-$$) db 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user