diff options
| author | Aleksa Vučković <aleksav013@gmail.com> | 2022-06-03 01:18:48 +0200 |
|---|---|---|
| committer | Aleksa Vučković <aleksav013@gmail.com> | 2022-06-03 01:18:48 +0200 |
| commit | 4fc9a5b06a0b50db6fc12d4ab7d937766e9ec8a7 (patch) | |
| tree | e992513313b988746ffc67e1753b1888e7ead69d | |
| parent | dd038cfb10cae6dba5afabc786a129224da5ef8c (diff) | |
cpuid_vendor_string
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | abi386-4.pdf | bin | 0 -> 1068001 bytes | |||
| -rw-r--r-- | src/as/cpuid.s | 23 | ||||
| -rw-r--r-- | src/c/kernel.c | 1 | ||||
| -rw-r--r-- | src/c/shell/neofetch.c | 12 | ||||
| -rw-r--r-- | src/include/source/cpuid.h | 8 |
6 files changed, 46 insertions, 4 deletions
@@ -50,11 +50,13 @@ ISO=$(TARGET).iso # OBJECTS ## AS OBJECTS -AS_OBJ=boot.o ioport.o gdt.o idt.o irq.o paging.o +AS_OBJ=boot.o ioport.o gdt.o idt.o irq.o paging.o cpuid.o export AS_OBJECTS=$(patsubst %,$(AS_OBJECT_DIR)/%,$(AS_OBJ)) ## C OBJECTS -C_OBJ=gdt.o heap.o idt.o kernel.o keyboard.o keymap.o stdio.o string.o tty.o vga.o irq_handler.o stack_protector.o timer.o paging.o shell/uptime.o shell/neofetch.o shell/game.o +C_OBJ=gdt.o heap.o idt.o kernel.o keyboard.o keymap.o stdio.o string.o tty.o \ +vga.o irq_handler.o stack_protector.o timer.o paging.o shell/uptime.o \ +shell/neofetch.o shell/game.o export C_OBJECTS=$(patsubst %,$(C_OBJECT_DIR)/%,$(C_OBJ)) ## ALL OBJECTS IN ORDER diff --git a/abi386-4.pdf b/abi386-4.pdf Binary files differnew file mode 100644 index 0000000..28ce48c --- /dev/null +++ b/abi386-4.pdf diff --git a/src/as/cpuid.s b/src/as/cpuid.s new file mode 100644 index 0000000..701fa0d --- /dev/null +++ b/src/as/cpuid.s @@ -0,0 +1,23 @@ +.global cpuid_vendor + +cpuid_vendor: + pushl %ebp + mov %esp, %ebp + pushl %ebx + pushl %edi + pushl %esi + + mov $0x0, %eax + cpuid + + movl 8(%ebp), %eax + + movl %ebx, (%eax) + movl %edx, 4(%eax) + movl %ecx, 8(%eax) + + popl %esi + popl %edi + popl %ebx + popl %ebp + ret diff --git a/src/c/kernel.c b/src/c/kernel.c index 72b2516..a5dc31a 100644 --- a/src/c/kernel.c +++ b/src/c/kernel.c @@ -7,7 +7,6 @@ #include<source/vga.h> #include<source/tty.h> - void kernel_main(void) { set_paging(); diff --git a/src/c/shell/neofetch.c b/src/c/shell/neofetch.c index e770428..4cfc250 100644 --- a/src/c/shell/neofetch.c +++ b/src/c/shell/neofetch.c @@ -3,6 +3,7 @@ #include<source/vga.h> #include<source/stdio.h> #include<source/timer.h> +#include<source/cpuid.h> void neofetch(void) { @@ -34,7 +35,16 @@ void neofetch(void) } printf("\n"); - set_color(VGA_COLOR_LIGHT_GREY,VGA_COLOR_BLACK); + + uint8_t cpuid_vendor_string[12]; + cpuid_vendor(cpuid_vendor_string); + + for (int i = 0; i < 12; i++) + { + printf("%c", cpuid_vendor_string[i]); + } + printf("\n"); + uptime(); } diff --git a/src/include/source/cpuid.h b/src/include/source/cpuid.h new file mode 100644 index 0000000..f194494 --- /dev/null +++ b/src/include/source/cpuid.h @@ -0,0 +1,8 @@ +#ifndef SOURCE_CPUID +#define SOURCE_CPUID + +#include<types.h> + +extern void cpuid_vendor(uint8_t cpuid_vendor_string[12]); + +#endif |
