Programs: loading, 1 fake syscall.. (bad) #12

Merged
xamidev merged 9 commits from programs into main 2024-09-23 16:41:44 +02:00
2 changed files with 8 additions and 3 deletions
Showing only changes of commit c885e69be4 - Show all commits

View File

@@ -78,14 +78,14 @@ void kmain(multiboot2_info *mb_info)
if (mmap->addr != 0) if (mmap->addr != 0)
{ {
/*
serial_printf(3, "base addr=0x%x%x, length=0x%x%x, type=%u", serial_printf(3, "base addr=0x%x%x, length=0x%x%x, type=%u",
(uint32_t) (mmap->addr >> 32), (uint32_t) (mmap->addr >> 32),
(uint32_t) (mmap->addr & 0xFFFFFFFF), (uint32_t) (mmap->addr & 0xFFFFFFFF),
(uint32_t) (mmap->len >> 32), (uint32_t) (mmap->len >> 32),
(uint32_t) (mmap->len & 0xFFFFFFFF), (uint32_t) (mmap->len & 0xFFFFFFFF),
mmap->type); mmap->type);
*/
} }
mmap = (struct multiboot_mmap_entry*) ((uint8_t*)mmap + mmap_tag->entry_size); mmap = (struct multiboot_mmap_entry*) ((uint8_t*)mmap + mmap_tag->entry_size);
@@ -128,6 +128,9 @@ void kmain(multiboot2_info *mb_info)
printf("LOADED!\n"); printf("LOADED!\n");
} }
void (*program_entry)() = (void (*)())binary_file;
program_entry();
timer_install(); timer_install();
keyboard_install(); keyboard_install();
printf("[kernel] spawning shell...\n"); printf("[kernel] spawning shell...\n");

View File

@@ -1,6 +1,8 @@
#include "../libc/stdio.h" #include "../libc/stdio.h"
#include "../drivers/serial.h"
void main() void main()
{ {
printf("Hello, world, from a PROGRAM!\n"); serial_printf(3, "Hello, world, from a PROGRAM!\n");
return;
} }