more fixes 💻
This commit is contained in:
parent
3ad196040e
commit
498b6dd8d3
15 changed files with 35 additions and 41 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1170,3 +1170,4 @@ gems-kernel.git/opt/cross/bin/i386-elf-c++
|
|||
gems-kernel.git/opt/cross/bin/i386-elf-as
|
||||
gems-kernel.git/opt/cross/bin/i386-elf-ar
|
||||
gems-kernel.git/opt/cross/bin/i386-elf-addr2line
|
||||
gems-kernel.git/Cross-Dev_Toolchain.i386&i686.x86_64.GCC_7_1_0.tar.gz
|
||||
|
|
6
gems-kernel.git/build.sh
Normal file → Executable file
6
gems-kernel.git/build.sh
Normal file → Executable file
|
@ -7,12 +7,12 @@ mkdir builds/iso
|
|||
mkdir builds/iso/boot
|
||||
mkdir builds/iso/boot/grub
|
||||
echo "Building bootloader"
|
||||
opt/cross/bin/i686-elf-gcc -std=gnu99 -ffreestanding -g -c start.s -o builds/blocks/bl.o
|
||||
nasm -f elf32 source/bootloader.asm -o builds/blocks/bl.o
|
||||
echo "Building basic keyboard support"
|
||||
nasm -f elf32 detect-kbinput.asm -o builds/blocks/detectkeys.o
|
||||
nasm -f elf32 source/detect-kbinput.asm -o builds/blocks/detectkeys.o
|
||||
echo "Building OS"
|
||||
set disassembly-flavor intel
|
||||
opt/cross/bin/i686-elf-gcc builds/blocks/bl.o builds/blocks/detectkeys.o os.c -w -g -ffreestanding -m32 -o builds/iso/gems.elf -I"/usr/include" -I"THIRDPARTY/lwext4-master/include/" -nostdlib
|
||||
opt/cross/bin/i686-elf-gcc builds/blocks/bl.o -ffreestanding -nostdlib builds/blocks/detectkeys.o source/os.c -w -g -m32 -o builds/iso/gems.elf -I"/usr/include" -I"source/THIRDPARTY/lwext4-master/include/" -I"source/THIRDPARTY/linux-old/include/linux" -I"source/THIRDPARTY/linux-old/include/asm"
|
||||
echo "Creating GRUB config"
|
||||
echo "set default=0" > builds/iso/boot/grub/grub.cfg
|
||||
echo "set timeout=60" >> builds/iso/boot/grub/grub.cfg
|
||||
|
|
BIN
gems-kernel.git/builds/blocks/bl.o
Normal file
BIN
gems-kernel.git/builds/blocks/bl.o
Normal file
Binary file not shown.
BIN
gems-kernel.git/builds/blocks/detectkeys.o
Normal file
BIN
gems-kernel.git/builds/blocks/detectkeys.o
Normal file
Binary file not shown.
BIN
gems-kernel.git/builds/gems.iso
Normal file
BIN
gems-kernel.git/builds/gems.iso
Normal file
Binary file not shown.
6
gems-kernel.git/builds/iso/boot/grub/grub.cfg
Normal file
6
gems-kernel.git/builds/iso/boot/grub/grub.cfg
Normal file
|
@ -0,0 +1,6 @@
|
|||
set default=0
|
||||
set timeout=60
|
||||
menuentry "GEMS" {
|
||||
multiboot /gems.elf
|
||||
boot
|
||||
}
|
BIN
gems-kernel.git/builds/iso/gems.elf
Executable file
BIN
gems-kernel.git/builds/iso/gems.elf
Executable file
Binary file not shown.
0
gems-kernel.git/create-iso.sh
Normal file → Executable file
0
gems-kernel.git/create-iso.sh
Normal file → Executable file
|
@ -0,0 +1 @@
|
|||
liblto_plugin.so.0.0.0
|
|
@ -0,0 +1 @@
|
|||
liblto_plugin.so.0.0.0
|
|
@ -0,0 +1 @@
|
|||
liblto_plugin.so.0.0.0
|
|
@ -0,0 +1 @@
|
|||
liblto_plugin.so.0.0.0
|
|
@ -1,38 +1,16 @@
|
|||
/* Deprecated */
|
||||
/* New one is start.s */
|
||||
SECTION .multiboot
|
||||
ALIGN 4
|
||||
extern kern
|
||||
mboot:
|
||||
MULTIBOOT_PAGE_ALIGN equ 1<<0
|
||||
MULTIBOOT_MEMORY_INFO equ 1<<1
|
||||
MULTIBOOT_AOUT_KLUDGE equ 1<<16
|
||||
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
|
||||
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_AOUT_KLUDGE
|
||||
MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
|
||||
EXTERN code, bss, end
|
||||
|
||||
dd MULTIBOOT_HEADER_MAGIC
|
||||
dd MULTIBOOT_HEADER_FLAGS
|
||||
dd MULTIBOOT_CHECKSUM
|
||||
|
||||
global exit
|
||||
extern _start
|
||||
mov ax, 9ch
|
||||
mov ss, ax ;cannot be written directly
|
||||
mov sp, 4094d
|
||||
mov ax, 7c0h
|
||||
mov ds, ax ;cannot be written directly
|
||||
MODULEALIGN equ 1<<0
|
||||
MEMINFO equ 1<<1
|
||||
|
||||
|
||||
loader:
|
||||
call _start
|
||||
call exit ;crash, forgot to add
|
||||
|
||||
exit:
|
||||
hlt
|
||||
jmp exit
|
||||
times 510-($-$$) db 0
|
||||
dw 0xAA55
|
||||
call loader ;darn i forgot to add this. probably whats causing the boot loop.
|
||||
mov ax, 9ch
|
||||
mov ss, ax ;cannot be written directly
|
||||
mov sp, 4094d
|
||||
mov ax, 7c0h
|
||||
mov ds, ax ;cannot be written directly
|
||||
call kern
|
||||
quit:
|
||||
hlt
|
||||
jmp quit
|
||||
jmp $
|
||||
times 510-($-$$) db 0
|
||||
dw 0xAA55
|
|
@ -1,8 +1,8 @@
|
|||
unsigned char inport(wchar_t keyid, wchar_t state) {
|
||||
unsigned char inport(char keyid, char state) {
|
||||
return inportb(keyid); //super hacky way to inport
|
||||
}
|
||||
|
||||
unsigned char outport(wchar_t scancode, wchar_t state) {
|
||||
unsigned char outport(char scancode, char state) {
|
||||
return (outport(scancode, state)); //hacky way to set key state.
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ void kbd_ack(void){
|
|||
}
|
||||
|
||||
|
||||
void kbd_led_handling(wchar_t ledstatus){;
|
||||
void kbd_led_handling(char ledstatus){;
|
||||
outport(0x60,0xed);
|
||||
kbd_ack();
|
||||
outport(0x60,ledstatus);
|
||||
|
|
|
@ -51,6 +51,10 @@ typedef struct multiboot_info {
|
|||
typedef mboot_memmap_t mmap_entry_t;
|
||||
typedef multiboot_info mmap_addr_length;
|
||||
|
||||
void exit() {
|
||||
panic("MISC CRASH");
|
||||
}
|
||||
|
||||
void os() {
|
||||
rloadstring("welcomescreen");
|
||||
rloadstring("helpscreen");
|
||||
|
@ -85,6 +89,7 @@ void kern() {
|
|||
panic("KERNEL-LEVEL CRASH");
|
||||
}
|
||||
}
|
||||
|
||||
int kernel_main(struct multiboot_info* mbd, unsigned int magic) {
|
||||
mmap_entry_t* entry = mbd->mmap_addr;
|
||||
while(entry < mbd->mmap_addr + mbd->mmap_length) {
|
||||
|
|
Loading…
Reference in a new issue