summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-10-07mm: add kzalloc helperCarlos Maiolino
Signed-off-by: Carlos Maiolino <[email protected]>
2025-09-14Enable interrupts only after IDT is setCarlos Maiolino
So far we've been playing a dangerous game... We enabled interrupts before we actually had the interrupt descriptor table setup. Fix this so we prevent IRQs to fire before the table is initialized and attempt to run garbage instead of code Signed-off-by: Carlos Maiolino <[email protected]>
2025-09-14Build heap and kernel_heapCarlos Maiolino
Wire the build of both the heap API and the kernel_heap in the Makefile Signed-off-by: Carlos Maiolino <[email protected]>
2025-09-14Add a kernel heapCarlos Maiolino
Use the heap API to implement a 100MiB heap to be used by the kernel code. Add example usage to src/kernel.c Signed-off-by: Carlos Maiolino <[email protected]>
2025-09-14heap_malloc_pages should check for a negative valueCarlos Maiolino
The first heap page (0x0) is a valid and usable page for now. When checking the starting page from heap_get_start_page(), we need to take that into account, otherwise we'll always return the first 0x0 page as the allocated page. This makes the users to always get 0x0 as the allocated region. We loose the possibility for error checking here, so we'll need to rework this API so we can get an error check. Signed-off-by: Carlos Maiolino <[email protected]>
2025-09-14Add a simple heap implementationCarlos Maiolino
Add a simple API implementing a heap memory area. This specifies 2 main data structures: struct heap - Defines a heap: Holds a table with all entries in the specific heap and the initial heap memory address struct heap_table - Describes the usage state of every PAGE within the specific heap. Signed-off-by: Carlos Maiolino <[email protected]>
2025-08-25Add error numbersCarlos Maiolino
This is supposed to be compliand with POSIX Signed-off-by: Carlos Maiolino <[email protected]>
2025-08-25Add math libCarlos Maiolino
So far I just need a roundup routine to implement a basic heap manager Signed-off-by: Carlos Maiolino <[email protected]>
2025-08-25IO: Add in/out declarations/definitionsCarlos Maiolino
I've forgotten to commit this when working on interrupts. The OS won't build without these helpers. They are used for now mostly to setup PICs. Signed-off-by: Carlos Maiolino <[email protected]>
2025-08-22vga.h: Fix unknown type nameCarlos Maiolino
This has only been working so far because vga.h was included only on source files already including stdint.h. We should put it direct to the header file Signed-off-by: Carlos Maiolino <[email protected]>
2025-08-01Setup interrupt handlingCarlos Maiolino
Remap master PIC to IOAddress 0x20 to avoid collisions with CPU exceptions. Setup a default interrupt handler and map all interrupts to this handler by default. Setup a Keyboard interrupt handler for testing purposes Wire everything up in the Makefile Signed-off-by: Carlos Maiolino <[email protected]>
2025-08-01Implement interrupt descriptor tableCarlos Maiolino
Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-26Add memset() to the libraryCarlos Maiolino
Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-26Move include files to a subdirectoryCarlos Maiolino
Move the include files to the toxic/ subdirectory, so it gets a bit more organized. Ah, yeah, OS name will be renamed to ToxicOS Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-25Build vga and string libsCarlos Maiolino
Also add a small test to the kernel code Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-25Add VGA text mode driverCarlos Maiolino
Add driver to deal with VGA text mode. Also adds a simple vprintl function while I don't implement a print library. Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-25Add string librariesCarlos Maiolino
Add a couple string lib functions to start with video text development. Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-21Fix boot.bin buildCarlos Maiolino
Previous patch TARGET variable definition got removed. I forgot to update its users.... Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-20Tidy up MakefileCarlos Maiolino
Remove some duplicate code by creating a few variables Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-20Add kernel.cCarlos Maiolino
Create the kernel.c file and its initial start_kernel(), and jump to it from the ASM. Also setup the build system to actually build it Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-20Force alignment of kerne code.Carlos Maiolino
It should be aligned to 16-bits IIRC, forcing the kernel.asm to be alined to a 512 byte boundary should suffice Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-20Add os.bin to makefileCarlos Maiolino
Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-17Add small ATA driver to load kernelCarlos Maiolino
Write ata_lba_read routine to load 100 disk sectors from the disk into memory address 0x00100000 (1MiB). Once the data is loaded, jump to that Address Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-17Start writing the kernel and add a linker scriptCarlos Maiolino
Move the code unders [BITS 32] label to its own file to be loaded as a kernel by the boot loader. Add a linker script to link the bootloader and the kernel in a single binary file. Add a build script to make it easier to use the cross compiler Update the Makefile to build everything and pack it into the os.bin Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-17Add build scriptCarlos Maiolino
Add a small script to use the cross compiler (from my machine), to build the kernel Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-17Enable A20 lineCarlos Maiolino
Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-17Restructure project folderCarlos Maiolino
Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-17Setup GDT and load protected modeCarlos Maiolino
Create a GDT table and use it to switch CPU into protected mode. This also gets rid of the print routines. Giving we won't have access to the BIOS interrupts once we switch the CPU to protected mode, they are pointless. Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-17Prepare for enabling protected modeCarlos Maiolino
Clean up all testing/playground code to prepare the bootloader to enable protected mode. Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-17Add gitignoreCarlos Maiolino
Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-17Remove interrupt tableCarlos Maiolino
Remove interrupt table setup and testing, IRQs will be added later on an interrupt descriptor table. For some reason once the exception is handled, the disk read fails, so just remove it for now Signed-off-by: Carlos Maiolino <[email protected]>
2025-07-17Initial commitCarlos Maiolino
Add a bootloader and a hello message. Signed-off-by: Carlos Maiolino <[email protected]>