Reverted to x86, refactored Makefile sysstem.
This commit is contained in:
parent
634393b141
commit
8b96940519
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
# Object files
|
# Object files
|
||||||
*.o
|
*.o
|
||||||
|
*.o_asm
|
||||||
*.ko
|
*.ko
|
||||||
*.obj
|
*.obj
|
||||||
*.elf
|
*.elf
|
||||||
|
70
Makefile
70
Makefile
@ -1,48 +1,74 @@
|
|||||||
LD = x86_64-elf-ld
|
LD = i686-elf-ld
|
||||||
LFLAGS = -melf_i386 -nostdlib -O2 -T link.ld
|
LFLAGS = -melf_i386 -nostdlib -O2 -T link.ld
|
||||||
|
|
||||||
all: prepare cpu kernel_code drivers libc userspace mem link iso
|
all: prepare cpu kernel_code drivers libc userspace mem link iso
|
||||||
|
|
||||||
prepare:
|
prepare:
|
||||||
mkdir -p obj/
|
@mkdir -p obj/
|
||||||
mkdir -p isodir/boot/grub/
|
@mkdir -p isodir/boot/grub/
|
||||||
cp grub.cfg isodir/boot/grub/grub.cfg
|
@echo [MKDIR] obj/
|
||||||
|
@echo [MKDIR] isodir/boot/grub
|
||||||
|
@cp grub.cfg isodir/boot/grub/grub.cfg
|
||||||
|
@echo [CP] grub.cfg isodir/boot/grub.cfg
|
||||||
|
|
||||||
cpu:
|
cpu:
|
||||||
make -C kernel/cpu
|
@echo [DIR] kernel/cpu
|
||||||
cp kernel/cpu/*.o obj/
|
@make -sC kernel/cpu
|
||||||
|
@cp kernel/cpu/*.o_asm obj/
|
||||||
|
@echo [CP] kernel/cpu/*.o obj/
|
||||||
|
|
||||||
kernel_code:
|
kernel_code:
|
||||||
make -C kernel
|
@echo [DIR] kernel/
|
||||||
cp kernel/*.o obj/
|
@make -sC kernel
|
||||||
|
@cp kernel/*.o obj/
|
||||||
|
@echo [CP] kernel/*.o obj/
|
||||||
|
|
||||||
drivers:
|
drivers:
|
||||||
make -C kernel/drivers/
|
@echo [DIR] kernel/drivers/
|
||||||
cp kernel/drivers/*.o obj/
|
@make -sC kernel/drivers
|
||||||
|
@cp kernel/drivers/*.o obj/
|
||||||
|
@echo [CP] kernel/drivers/*.o obj/
|
||||||
|
|
||||||
libc:
|
libc:
|
||||||
make -C kernel/libc
|
@echo [DIR] kernel/libc/
|
||||||
cp kernel/libc/*.o obj/
|
@make -sC kernel/libc
|
||||||
|
@cp kernel/libc/*.o obj/
|
||||||
|
@echo [CP] kernel/libc/*.o obj/
|
||||||
|
|
||||||
userspace:
|
userspace:
|
||||||
make -C kernel/userspace
|
@echo [DIR] kernel/userspace/
|
||||||
cp kernel/userspace/*.o obj/
|
@make -sC kernel/userspace
|
||||||
|
@cp kernel/userspace/*.o obj/
|
||||||
|
@echo [CP] kernel/userspace/*.o obj/
|
||||||
|
|
||||||
mem:
|
mem:
|
||||||
make -C kernel/mem
|
@echo [DIR] kernel/mem
|
||||||
cp kernel/mem/*.o obj/
|
@make -sC kernel/mem
|
||||||
|
@cp kernel/mem/*.o obj/
|
||||||
|
@echo [CP] kernel/mem/*.o obj/
|
||||||
|
|
||||||
link:
|
link:
|
||||||
$(LD) $(LFLAGS) -o isodir/boot/vulcanos.bin obj/*.o
|
@$(LD) $(LFLAGS) -o isodir/boot/vulcanos.bin obj/*.o obj/*.o_asm
|
||||||
|
@echo [LD] Linking blob...
|
||||||
|
|
||||||
iso:
|
iso:
|
||||||
grub-mkrescue isodir -o vulcanos.iso
|
@echo [ISO] Creating ISO file...
|
||||||
|
@grub-mkrescue isodir -o vulcanos.iso > /dev/null 2>&1
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf obj/ kernel/*.o kernel/cpu/*.o
|
@rm -rf obj/ kernel/*.o kernel/cpu/*.o_asm
|
||||||
rm -rf kernel/userspace/*.o kernel/mem/*.o
|
@echo [RM] obj
|
||||||
rm -rf kernel/drivers/*.o kernel/libc/*.o
|
@echo [RM] kernel/*.o
|
||||||
rm -rf vulcanos.iso bochslog.txt commands isodir
|
@echo [RM] kernel/cpu/*.o_asm
|
||||||
|
@rm -rf kernel/userspace/*.o kernel/mem/*.o
|
||||||
|
@echo [RM] kernel/userspace/*.o
|
||||||
|
@echo [RM] kernel/mem/*.o
|
||||||
|
@rm -rf kernel/drivers/*.o kernel/libc/*.o
|
||||||
|
@echo [RM] kernel/drivers/*.o
|
||||||
|
@echo [RM] kernel/libc/*.o
|
||||||
|
@rm -rf vulcanos.iso bochslog.txt commands isodir
|
||||||
|
@echo [RM] vulcanos.iso
|
||||||
|
@echo [RM] isodir
|
||||||
|
|
||||||
bochs:
|
bochs:
|
||||||
bochs -f bochs_cfg -q
|
bochs -f bochs_cfg -q
|
||||||
|
@ -19,7 +19,7 @@ After that, you can build VulcanOS just by running the commands below:
|
|||||||
2. Type `make run` to start it in QEMU or `make bochs` to start it with bochs.
|
2. Type `make run` to start it in QEMU or `make bochs` to start it with bochs.
|
||||||
|
|
||||||
You can also find an ISO file
|
You can also find an ISO file
|
||||||
[here](https://github.com/ice-bit/vulcanos/raw/master/imgs/vulcanos.iso)(md5sum: `a706cdfeea573e08550e599717d3f519`)
|
[here](https://github.com/ice-bit/vulcanos/raw/master/imgs/vulcanos.iso)(md5sum: `11375e1e169069b85c14d3cb6c5a4f06`)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
Right now, VulcanOS supports the following features:
|
Right now, VulcanOS supports the following features:
|
||||||
|
Binary file not shown.
@ -1,10 +1,11 @@
|
|||||||
OBJS = kernel_main.o
|
OBJS = kernel_main.o
|
||||||
|
|
||||||
CC = x86_64-elf-gcc # cross-compiler
|
CC = i686-elf-gcc # cross-compiler
|
||||||
CFLAGS = -m32 -fno-stack-protector -ffreestanding -Wall -Wextra -Werror -g -c
|
CFLAGS = -m32 -fno-stack-protector -ffreestanding -Wall -Wextra -Werror -g -c
|
||||||
|
|
||||||
|
|
||||||
all: ${OBJS}
|
all: ${OBJS}
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $(CFLAGS) $< -o $@
|
@$(CC) $(CFLAGS) $< -o $@
|
||||||
|
@echo [CC] Compiling $<...
|
@ -1,9 +1,12 @@
|
|||||||
OBJS = main.asm.o main64.asm.o ports.asm.o \
|
SOURCES = main.asm ports.asm \
|
||||||
gdt.asm.o idt.asm.o \
|
gdt.asm idt.asm \
|
||||||
interrupts.asm.o header.asm.o
|
interrupts.asm header.asm
|
||||||
|
OBJS = $(SOURCES:.asm=.o_asm)
|
||||||
ASM = nasm
|
ASM = nasm
|
||||||
ASMFLAGS = -f elf32
|
ASMFLAGS = -f elf32
|
||||||
|
|
||||||
all: $(OBJS)
|
all: $(OBJS)
|
||||||
%.asm.o: %.asm
|
|
||||||
$(ASM) $(ASMFLAGS) $< -o $@
|
%.o_asm: %.asm
|
||||||
|
@$(ASM) $(ASMFLAGS) $< -o $@
|
||||||
|
@echo [ASM] compiling $<...
|
@ -5,169 +5,23 @@
|
|||||||
; Released under GPLv3 ;
|
; Released under GPLv3 ;
|
||||||
; https://github.com/ice-bit/vulcanos ;
|
; https://github.com/ice-bit/vulcanos ;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
GLOBAL kernel_loader
|
||||||
EXTERN long_mode_start
|
EXTERN kernel_main
|
||||||
[BITS 32] ; Ensure we are in protected mode
|
[BITS 32] ; Ensure we are in protected mode
|
||||||
|
|
||||||
section .text
|
section .text
|
||||||
kernel_loader:
|
kernel_loader:
|
||||||
mov esp, kernel_stack + KERNEL_STACK_SZ ; Define stack pointer
|
mov esp, kernel_stack + KERNEL_STACK_SZ ; Define stack pointer
|
||||||
; Now we need to switch to Long Mode(i.e., 64bit mode)
|
|
||||||
; to do that, we first need to check if we actually are
|
|
||||||
; being loaded by a multiboot compliant bootloader. Then,
|
|
||||||
; we will execute CPUID instruction in order to obtain details
|
|
||||||
; about out CPU(i.e., if the CPU supports long mode).
|
|
||||||
call check_multiboot
|
|
||||||
call check_cpuid
|
|
||||||
call check_long_mode
|
|
||||||
|
|
||||||
; After that, we need to setup paging
|
|
||||||
call setup_page_tables
|
|
||||||
call enable_paging
|
|
||||||
|
|
||||||
; We also need to load a GDT
|
|
||||||
lgdt[gdt64.pointer]
|
|
||||||
jmp gdt64.code_segment:long_mode_start
|
|
||||||
push eax ; Set multiboot header register
|
push eax ; Set multiboot header register
|
||||||
|
call kernel_main ; Call kernel's main function
|
||||||
|
|
||||||
check_multiboot:
|
|
||||||
; To prove that we are being loaded by a multiboot
|
|
||||||
; bootloader, we can read the EAX register to see if
|
|
||||||
; it contains the magic number
|
|
||||||
cmp eax, 0xE85250D6
|
|
||||||
jne .multiboot_panic
|
|
||||||
ret
|
|
||||||
|
|
||||||
.multiboot_panic:
|
|
||||||
; We handle this error by showing a special code
|
|
||||||
mov al, "M"
|
|
||||||
jmp error ; Call print routine
|
|
||||||
|
|
||||||
check_cpuid:
|
|
||||||
; To check if CPUID is available we need to flip
|
|
||||||
; ID bit of the flag register, if this is possibile
|
|
||||||
; then CPUID instruction is available. In order to achieve
|
|
||||||
pushfd ; Push flag register into the stack
|
|
||||||
pop eax ; Pop the stack
|
|
||||||
mov ecx, eax ; Make a copy of the stack
|
|
||||||
xor eax, 1 << 21 ; Flip ID bit(21th) from the eax register
|
|
||||||
push eax
|
|
||||||
popfd ; Restore flag register into the stack
|
|
||||||
pushfd
|
|
||||||
pop eax
|
|
||||||
push ecx
|
|
||||||
popfd
|
|
||||||
cmp eax, ecx ; If values are the same, then CPUID is not available
|
|
||||||
je .cpuid_panic
|
|
||||||
ret ; Otherwise return
|
|
||||||
|
|
||||||
.cpuid_panic:
|
|
||||||
mov al, "C"
|
|
||||||
jmp error ; Call print routine
|
|
||||||
|
|
||||||
|
|
||||||
check_long_mode:
|
|
||||||
; Check if CPU supports extended processor info
|
|
||||||
mov eax, 0x80000000 ; Store magic number
|
|
||||||
cpuid ; CPUID instruction takes EAX by default
|
|
||||||
; CPUID will set EAX a value greater than the magic number
|
|
||||||
; if the processor supports extended processor info
|
|
||||||
cmp eax, 0x80000001 ; Magic number + 1
|
|
||||||
jb .long_mode_panic
|
|
||||||
; Otherwise we can use extended processor info
|
|
||||||
; to check if long mode is available
|
|
||||||
mov eax, 0x80000001
|
|
||||||
cpuid
|
|
||||||
; CPUID, with this magic number, will set LM bit(29th)
|
|
||||||
; if and only if long mode is available
|
|
||||||
test edx, 1 << 29
|
|
||||||
jz .long_mode_panic
|
|
||||||
ret
|
|
||||||
|
|
||||||
.long_mode_panic:
|
|
||||||
mov al, "L"
|
|
||||||
jmp error ; Call print routine
|
|
||||||
|
|
||||||
|
|
||||||
setup_page_tables:
|
|
||||||
mov eax, page_table_l3
|
|
||||||
or eax, 0b11
|
|
||||||
mov [page_table_l4], eax
|
|
||||||
|
|
||||||
mov eax, page_table_l2
|
|
||||||
or eax, 0b11
|
|
||||||
mov [page_table_l3], eax
|
|
||||||
|
|
||||||
.loop:
|
.loop:
|
||||||
mov eax, 0x200000 ; 2MiB
|
jmp .loop ; If the kernel returns, go into an endless loop
|
||||||
mul ecx
|
; This will prevent the CPU to execure any non-kernel
|
||||||
or eax, 0b10000011
|
; instructions.
|
||||||
mov [page_table_l2 + ecx * 8], eax
|
|
||||||
|
|
||||||
mov ecx, 0 ; Counter
|
|
||||||
inc ecx ; Increment counter
|
|
||||||
cmp ecx, 512 ; Check if whole table is being mapped
|
|
||||||
jne .loop ; if not, repeat
|
|
||||||
ret
|
|
||||||
|
|
||||||
enable_paging:
|
|
||||||
; Pass page table location to the cpu
|
|
||||||
mov eax, page_table_l4
|
|
||||||
mov cr3, eax
|
|
||||||
; Enable PAE
|
|
||||||
mov eax, cr4
|
|
||||||
or eax, 1 << 5
|
|
||||||
mov cr4, eax;
|
|
||||||
; Enable long mode
|
|
||||||
mov ecx, 0xC0000000
|
|
||||||
rdmsr
|
|
||||||
or eax, 1 << 8
|
|
||||||
wrmsr
|
|
||||||
; Enable paging
|
|
||||||
mov eax, cr0
|
|
||||||
or eax, 1 << 31
|
|
||||||
mov cr0, eax
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
error: ; Prints "ERR: X" where X stands ofr the given error code
|
|
||||||
; This routine will just print the error code in video memory
|
|
||||||
; Let's understand what those hex codes actually mean:
|
|
||||||
; 0xB8000 is the begin of the VGA text buffer, each byte will
|
|
||||||
; contain one character. 0x4F is the color code; it means
|
|
||||||
; white text on read background. 0x52 is the ASCII code for
|
|
||||||
; the letter 'R', while 0x45 stands for the letter 'E',
|
|
||||||
; 0x3A stands for the symbol ':' and 0x20 is just a space.
|
|
||||||
; Do note that addressing is in little endian ordering and
|
|
||||||
; that one space is begin overwritten by the ASCII byte.
|
|
||||||
; previous NEW CONTENT
|
|
||||||
mov dword [0xB8000], 0x4F524F45 ; [] ER
|
|
||||||
mov dword [0xB8004], 0x4F3A4F52 ; [ER] R:
|
|
||||||
mov dword [0xB8008], 0x4F204F20 ; [ERR:] <space>
|
|
||||||
mov byte [0xB800a], al ; Print the error code
|
|
||||||
hlt ; Halt the CPU
|
|
||||||
|
|
||||||
KERNEL_STACK_SZ equ 4096 ; Stack size(4KiB)
|
KERNEL_STACK_SZ equ 4096 ; Stack size(4KiB)
|
||||||
|
|
||||||
section .bss
|
section .bss
|
||||||
align 4096
|
align 4
|
||||||
page_table_l4:
|
|
||||||
resb 4096
|
|
||||||
page_table_l3:
|
|
||||||
resb 4096
|
|
||||||
page_table_l2:
|
|
||||||
resb 4096
|
|
||||||
kernel_stack:
|
kernel_stack:
|
||||||
resb KERNEL_STACK_SZ ; Reserver 4KiB for kernel's stack
|
resb KERNEL_STACK_SZ ; Reserver 4KiB for kernel's stack
|
||||||
|
|
||||||
|
|
||||||
section .rodata
|
|
||||||
gdt64:
|
|
||||||
dq 0 ; zero entry
|
|
||||||
.code_segment: equ $ - gdt64
|
|
||||||
dq (1 << 4) | (1 << 44) | (1 << 47) | (1 << 53) ; Code segment
|
|
||||||
; executable, descriptor, present 64bit flags
|
|
||||||
.pointer:
|
|
||||||
dw $ - gdt64 - 1
|
|
||||||
dd gdt64
|
|
@ -1,27 +0,0 @@
|
|||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
; vulcanOS Kernel ;
|
|
||||||
; Developed by Marco 'icebit' Cetica ;
|
|
||||||
; (c) 2019-2021 ;
|
|
||||||
; Released under GPLv3 ;
|
|
||||||
; https://github.com/ice-bit/vulcanos ;
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
GLOBAL long_mode_start
|
|
||||||
GLOBAL kernel_loader
|
|
||||||
EXTERN kernel_main
|
|
||||||
section .text
|
|
||||||
[BITS 64] ; Ensure we are in long mode
|
|
||||||
|
|
||||||
long_mode_start:
|
|
||||||
xor ax, ax
|
|
||||||
mov ss, ax
|
|
||||||
mov ds, ax
|
|
||||||
mov es, ax
|
|
||||||
mov fs, ax
|
|
||||||
mov gs, ax
|
|
||||||
|
|
||||||
; Call the kernel's main method
|
|
||||||
call kernel_main ; Call kernel's main function
|
|
||||||
.loop:
|
|
||||||
jmp .loop ; If the kernel returns, go into an endless loop
|
|
||||||
; This will prevent the CPU to execure any non-kernel
|
|
||||||
; instructions.
|
|
@ -1,11 +1,12 @@
|
|||||||
OBJS = tty.o gdt.o idt.o isr.o timer.o keyboard.o \
|
OBJS = tty.o gdt.o idt.o isr.o timer.o keyboard.o \
|
||||||
fs.o cpuid.o
|
fs.o cpuid.o
|
||||||
|
|
||||||
CC = x86_64-elf-gcc # cross-compiler
|
CC = i686-elf-gcc # cross-compiler
|
||||||
CFLAGS = -m32 -fno-stack-protector -DDEFAULT_USER=root -DDEFAULT_HOSTNAME=vulcan -ffreestanding -Wall -Wextra -Werror -g -c
|
CFLAGS = -m32 -fno-stack-protector -DDEFAULT_USER=root -DDEFAULT_HOSTNAME=vulcan -ffreestanding -Wall -Wextra -Werror -g -c
|
||||||
|
|
||||||
|
|
||||||
all:${OBJS}
|
all:${OBJS}
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $(CFLAGS) $< -o $@
|
@$(CC) $(CFLAGS) $< -o $@
|
||||||
|
@echo [CC] Compiling $<...
|
@ -6,7 +6,7 @@
|
|||||||
* https://github.com/ice-bit/vulcanos *
|
* https://github.com/ice-bit/vulcanos *
|
||||||
*****************************************/
|
*****************************************/
|
||||||
#include "drivers/tty.h"
|
#include "drivers/tty.h"
|
||||||
//#include "drivers/gdt.h"
|
#include "drivers/gdt.h"
|
||||||
#include "drivers/idt.h"
|
#include "drivers/idt.h"
|
||||||
#include "drivers/timer.h"
|
#include "drivers/timer.h"
|
||||||
#include "drivers/keyboard.h"
|
#include "drivers/keyboard.h"
|
||||||
@ -41,9 +41,9 @@ void kernel_main(unsigned long magic, uint32_t addr) {
|
|||||||
|
|
||||||
printf("Loading kernel, wait please...");
|
printf("Loading kernel, wait please...");
|
||||||
|
|
||||||
// gdt_setup(); // Setup Global Descriptor Table
|
gdt_setup(); // Setup Global Descriptor Table
|
||||||
// PRTOK
|
PRTOK
|
||||||
// printf(" - Loaded GDT");
|
printf(" - Loaded GDT");
|
||||||
|
|
||||||
idt_setup(); // Setup Interrupt Descriptor Table
|
idt_setup(); // Setup Interrupt Descriptor Table
|
||||||
PRTOK
|
PRTOK
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
OBJS = stdio.o string.o panic.o time.o
|
OBJS = stdio.o string.o panic.o time.o
|
||||||
VER := $(shell git rev-parse --short HEAD)
|
VER := $(shell git rev-parse --short HEAD)
|
||||||
|
|
||||||
CC = x86_64-elf-gcc # cross-compiler
|
CC = i686-elf-gcc # cross-compiler
|
||||||
CFLAGS = -DVULCAN_VERSION=$(VER) -m32 -fno-stack-protector -ffreestanding -Wall -Wextra -Werror -g -c
|
CFLAGS = -m32 -DVULCAN_VERSION=$(VER) -fno-stack-protector -ffreestanding -Wall -Wextra -Werror -g -c
|
||||||
|
|
||||||
|
|
||||||
all:${OBJS}
|
all:${OBJS}
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $(CFLAGS) $< -o $@
|
@$(CC) $(CFLAGS) $< -o $@
|
||||||
|
@echo [CC] Compiling $<...
|
@ -1,9 +1,10 @@
|
|||||||
OBJS = paging.o kheap.o ordered_array.o
|
OBJS = paging.o kheap.o ordered_array.o
|
||||||
|
|
||||||
CC = x86_64-elf-gcc # cross-compiler
|
CC = i686-elf-gcc # cross-compiler
|
||||||
CFLAGS = -m32 -fno-stack-protector -ffreestanding -Wall -Wextra -Werror -g -c
|
CFLAGS = -m32 -fno-stack-protector -ffreestanding -Wall -Wextra -Werror -g -c
|
||||||
|
|
||||||
all:${OBJS}
|
all:${OBJS}
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
${CC} ${CFLAGS} $< -o $@
|
@${CC} ${CFLAGS} $< -o $@
|
||||||
|
@echo [CC] Compiling $<...
|
@ -1,10 +1,11 @@
|
|||||||
OBJS = shell.o fetch.o
|
OBJS = shell.o fetch.o
|
||||||
VER := $(shell git rev-parse --short HEAD)
|
VER := $(shell git rev-parse --short HEAD)
|
||||||
|
|
||||||
CC = x86_64-elf-gcc # cross-compiler
|
CC = i686-elf-gcc # cross-compiler
|
||||||
CFLAGS = -DDEFAULT_USER=root -DDEFAULT_HOSTNAME=vulcan -DVULCAN_VERSION=$(VER) -m32 -fno-stack-protector -ffreestanding -Wall -Wextra -Werror -g -c
|
CFLAGS = -m32 -DDEFAULT_USER=root -DDEFAULT_HOSTNAME=vulcan -DVULCAN_VERSION=$(VER) -fno-stack-protector -ffreestanding -Wall -Wextra -Werror -g -c
|
||||||
|
|
||||||
all:${OBJS}
|
all:${OBJS}
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $(CFLAGS) $< -o $@
|
@$(CC) $(CFLAGS) $< -o $@
|
||||||
|
@echo [CC] Compiling $<...
|
@ -10,7 +10,6 @@ void helper() {
|
|||||||
puts("\nList of available commands:\n"
|
puts("\nList of available commands:\n"
|
||||||
"\nhelp - Print this helper"
|
"\nhelp - Print this helper"
|
||||||
"\nint - Test some interrupts"
|
"\nint - Test some interrupts"
|
||||||
"\nbanner - Show banner"
|
|
||||||
"\nclear, cls - Clear the screen"
|
"\nclear, cls - Clear the screen"
|
||||||
"\nregs - Prints register dump"
|
"\nregs - Prints register dump"
|
||||||
"\ntimer - Prints timer tick"
|
"\ntimer - Prints timer tick"
|
||||||
@ -27,23 +26,34 @@ void test_interrupts() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void about() {
|
void about() {
|
||||||
printf_color("\n====== IceOS v0.0.1 (c) 2019 Marco 'icebit' Cetica ======\n\n",
|
printf_color("\n \\ /,\n", LIGHT_RED, BLACK);
|
||||||
LIGHT_CYAN, BLACK);
|
printf_color(" _________)) ((__________\n", LIGHT_RED, BLACK);
|
||||||
printf_color(
|
printf_color(" /.-------./\\\\ \\ / //\\.--------.\\", LIGHT_RED, BLACK);
|
||||||
"iceOS is a x86 monolithic kernel written in C from scratch.\n"
|
printf_color(" Vulcan", LIGHT_MAGENTA, BLACK);
|
||||||
"This project doesn't aim to be a fully functional operating system\n"
|
printf_color("OS ", LIGHT_BROWN, BLACK);
|
||||||
"with tons of drivers and graphical applications,\nit's just a learning tool "
|
printf_color("is x86 monolithic \n", LIGHT_GREEN, BLACK);
|
||||||
"to teach myself concepts like\nOperating Systems, Computer Architecture and Digital Electronics.\n"
|
printf_color(" //#######//##\\\\ )) (( //##\\\\########\\\\", LIGHT_RED, BLACK);
|
||||||
"\n\n"
|
printf_color(" kernel written from scratch \n", LIGHT_GREEN, BLACK);
|
||||||
"iceOS comes with the following features:\n"
|
printf_color(" //#######//###(( (( )) ))###\\\\########\\\\", LIGHT_RED, BLACK);
|
||||||
"- Bare metal booting;\n"
|
printf_color(" in C following the UNIX \n", LIGHT_GREEN, BLACK);
|
||||||
"- VGA driver;\n"
|
printf_color("((#######((#####\\\\ \\\\ // //#####))########))", LIGHT_RED, BLACK);
|
||||||
"- Interrupts implementation;\n"
|
printf_color(" philosophy. \n", LIGHT_GREEN, BLACK);
|
||||||
"- PIC & PIT implementation;\n"
|
printf_color(" \\##' `###\\######\\\\ \\)(/ //######/####' `##/", LIGHT_RED, BLACK);
|
||||||
"- PS2 driver;\n"
|
printf_color(" By Marco Cetica 2019-2021 \n", LIGHT_GREEN, BLACK);
|
||||||
"- Support for x86 architecture;\n"
|
printf_color(" )' ``#)' `##\\`->oo<-'/##' `(#'' `(", LIGHT_RED, BLACK);
|
||||||
"- GRUB as bootloader;\n",
|
printf_color(" https://git.io/JtzuAs\n", WHITE, BLACK);
|
||||||
LIGHT_GREEN, BLACK);
|
printf_color(" ( ``\\`..'/'' )\n", LIGHT_RED, BLACK);
|
||||||
|
printf_color(" \\''(\n", LIGHT_RED, BLACK);
|
||||||
|
printf_color(" `- )\n", LIGHT_RED, BLACK);
|
||||||
|
printf_color(" / /\n", LIGHT_RED, BLACK);
|
||||||
|
printf_color(" ( /\\\n", LIGHT_RED, BLACK);
|
||||||
|
printf_color(" /\\| \\\n", LIGHT_RED, BLACK);
|
||||||
|
printf_color(" ( \\\n", LIGHT_RED, BLACK);
|
||||||
|
printf_color(" )\n", LIGHT_RED, BLACK);
|
||||||
|
printf_color(" /\n", LIGHT_RED, BLACK);
|
||||||
|
printf_color(" (\n", LIGHT_RED, BLACK);
|
||||||
|
printf_color(" `\n", LIGHT_RED, BLACK);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void register_dump() {
|
void register_dump() {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
/**************************************
|
/*****************************************
|
||||||
* VulcanOS Kernel *
|
* VulcanOS Kernel *
|
||||||
* Developed by Marco 'icebit' Cetica *
|
* Developed by Marco 'icebit' Cetica *
|
||||||
* (c) 2019-2021 *
|
* (c) 2019-2021 *
|
||||||
* Released under GPLv3 *
|
* Released under GPLv3 *
|
||||||
* https://github.com/ice-bit/iceOS *
|
* https://github.com/ice-bit/vulcanos *
|
||||||
***************************************/
|
*****************************************/
|
||||||
#ifndef _SHELL_H_
|
#ifndef _SHELL_H_
|
||||||
#define _SHELL_H_
|
#define _SHELL_H_
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user