diff --git a/README.md b/README.md index b401460..84d6e7a 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,13 @@ Then you can run those commands: iceOS already have/will have the following features: - [x] Bare metal booting; - [x] VGA driver; -- [ ] Interrupts implementation; +- [x] Interrupts implementation; - [ ] PIC & PIT implementation; - [ ] PS2 driver; -- [ ] Support for x86 architecture; -- [x] GRUB as bootloader. - +- [x] Support for x86 architecture; +- [x] GRUB as bootloader; +- [ ] Paging; +- [ ] Dynamic memory allocation(heap). ## Resources This project is made with different kind of resources and different kind of knowledges, before starting it i read/studied the following resources: @@ -34,5 +35,6 @@ This project is made with different kind of resources and different kind of know - [Operating System Concepts - Silberschatz (2016)](https://www.amazon.it/Sistemi-operativi-Concetti-ed-esempi/dp/8865183713/ref=pd_lpo_sbs_14_img_1?_encoding=UTF8&psc=1&refRID=4A5T2C7KKH7RA0K1T7RV) - [The Art Of Electronics - Horowitz (2015)](https://www.amazon.it/gp/product/0521809266/ref=ppx_od_dt_b_asin_title_s00?ie=UTF8&psc=1) - [OSDev wiki](https://wiki.osdev.org/Main_Page) +- [The Little Book About OS Development](https://littleosbook.github.io/) ## License iceOS is released under GPLv3, you can obtain a copy of this license by cloning the repository or by visiting [this](https://opensource.org/licenses/GPL-3.0) page. \ No newline at end of file diff --git a/iceOS.iso b/iceOS.iso new file mode 100644 index 0000000..3753cd6 Binary files /dev/null and b/iceOS.iso differ diff --git a/isodir/boot/grub/grub.cfg b/isodir/boot/grub/grub.cfg new file mode 100644 index 0000000..11f924c --- /dev/null +++ b/isodir/boot/grub/grub.cfg @@ -0,0 +1,7 @@ +set timeout = 0 +set default = 0 + +menuentry "iceOS" { + multiboot2 /boot/iceOS.bin + boot +} diff --git a/isodir/boot/iceOS.bin b/isodir/boot/iceOS.bin new file mode 100755 index 0000000..cd91922 Binary files /dev/null and b/isodir/boot/iceOS.bin differ diff --git a/kernel/cpu/ports.asm b/kernel/cpu/ports.asm index 7b92fbe..271c44a 100644 --- a/kernel/cpu/ports.asm +++ b/kernel/cpu/ports.asm @@ -10,7 +10,7 @@ global outb ; Output from port global inb ; Input to port outb: - mov al, [esp + 3] + mov al, [esp + 8] mov dx, [esp + 4] out dx, al ret diff --git a/kernel/drivers/idt.c b/kernel/drivers/idt.c index b722873..4ca3936 100644 --- a/kernel/drivers/idt.c +++ b/kernel/drivers/idt.c @@ -97,7 +97,7 @@ static void init_idt() { __asm__ __volatile__ ("sti"); } -// Taken here: http://wiki.osdev.org/8259_PIC +// Taken from: http://wiki.osdev.org/8259_PIC static void pic_remap(uint8_t offset1, uint8_t offset2) { uint8_t a1, a2; diff --git a/kernel/drivers/isr.c b/kernel/drivers/isr.c index 7e30c4e..6e02fee 100644 --- a/kernel/drivers/isr.c +++ b/kernel/drivers/isr.c @@ -56,7 +56,8 @@ void isr_handler(registers_t regs) { isr_t handler = interrupt_handler[regs.int_num]; handler(regs); } else { - kprint_c((uint8_t*)"Received interrupt: ", 20, LIGHT_BROWN, BLACK); + uint8_t *buf = (uint8_t*)"\nReceived interrupt: "; + kprint_c((uint8_t*)buf,strlen(buf), LIGHT_BROWN, BLACK); kprint_c(interrupts_messages[(uint8_t)regs.int_num], strlen(interrupts_messages[(uint8_t)regs.int_num]), WHITE, diff --git a/kernel/kernel_main.c b/kernel/kernel_main.c index 819ad12..b657a43 100644 --- a/kernel/kernel_main.c +++ b/kernel/kernel_main.c @@ -4,10 +4,17 @@ #include "libc/stdio.h" void kernel_main() { - clear_prompt(); - init_prompt(); // Initialize frame buffer gdt_setup(); // Setup Global Descriptor Table idt_setup(); // Setup Interrupt Descriptor Table + clear_prompt(); + init_prompt(); // Initialize frame buffer puts("Hello World!"); + + /* + // Testing some interrupts + asm("int $0"); // Division by zero + asm("int $4"); // Stack overflow + asm("int $1"); // Page fault + */ } \ No newline at end of file