Добавлена функция получение последнего использованного цвета

This commit is contained in:
Aren Elchinyan 2023-12-14 11:25:53 +03:00
parent 65b35be40f
commit 56d3e73f6d
4 changed files with 40 additions and 2 deletions

View File

@ -12,11 +12,40 @@
#include <stdint.h> #include <stdint.h>
struct frame {
uint64_t rbp;
uint64_t rbx;
uint64_t r15;
uint64_t r14;
uint64_t r13;
uint64_t r12;
uint64_t r11;
uint64_t r10;
uint64_t r9;
uint64_t r8;
uint64_t rax;
uint64_t rcx;
uint64_t rdx;
uint64_t rsi;
uint64_t rdi;
uint64_t int_number;
uint64_t err;
uint64_t rip;
uint64_t cs;
uint64_t rflags;
uint64_t rsp;
uint64_t ss;
} __attribute__((packed));
typedef void (*int_entry_t)(struct frame *state);
void arch_init( ); void arch_init( );
void cpu_init( ); void cpu_init( );
void gdt_init( ); void gdt_init( );
void pic_init( );
void pit_init( );
void idt_init( ); void idt_init( );
void idt_set_int(uint8_t vector, void *int_handler); void idt_set_int(uint8_t vector, int_entry_t handler);
uint64_t arch_get_tick_b( ); uint64_t arch_get_tick_b( );
uint64_t arch_get_tick_l( ); uint64_t arch_get_tick_l( );
uint64_t arch_get_tick( ); uint64_t arch_get_tick( );
@ -41,4 +70,8 @@ static inline uint16_t inw(uint16_t port) {
return ret; return ret;
} }
static inline void io_wait( ) {
outb(0x80, 0);
}
#endif // arch.h #endif // arch.h

View File

@ -42,6 +42,7 @@ enum colors {
#endif #endif
void fb_set_text_color(uint32_t color); void fb_set_text_color(uint32_t color);
uint32_t fb_get_text_color( );
void fb_init( ); void fb_init( );
void fb_print_buf(size_t x, size_t y, size_t h, size_t w, uint32_t *buf); void fb_print_buf(size_t x, size_t y, size_t h, size_t w, uint32_t *buf);
void fb_printf(char *str, ...); void fb_printf(char *str, ...);

View File

@ -1,3 +1,3 @@
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 1 #define VERSION_MINOR 1
#define VERSION_BUILD 771 #define VERSION_BUILD 837

View File

@ -33,6 +33,10 @@ uint16_t bpp;
uint64_t pos_x = 4; uint64_t pos_x = 4;
uint64_t pos_y = 4; uint64_t pos_y = 4;
uint32_t fb_get_text_color( ) {
return text_color;
}
void fb_set_text_color(uint32_t color) { void fb_set_text_color(uint32_t color) {
text_color = color; text_color = color;
} }