Mercurial > lcfOS
comparison cos/kernel/kernel.h @ 24:d8627924d40d
Split up in more files and reboot command
author | windel |
---|---|
date | Fri, 02 Dec 2011 14:00:02 +0100 |
parents | b1fed2171e1a |
children | d3c4bf3720a3 |
comparison
equal
deleted
inserted
replaced
23:5dd47d6eebac | 24:d8627924d40d |
---|---|
25 uint16_t limit; | 25 uint16_t limit; |
26 uint64_t base; | 26 uint64_t base; |
27 } __attribute__((packed)) idtPointer; | 27 } __attribute__((packed)) idtPointer; |
28 | 28 |
29 // memory alloc functions: | 29 // memory alloc functions: |
30 void init_heap(); | |
30 void* kmalloc(uint64_t size); | 31 void* kmalloc(uint64_t size); |
31 void kfree(void* ptr); | 32 void kfree(void* ptr); |
32 | 33 |
33 // STDout funcs: | 34 // STDout funcs: |
34 void printf(const char* fmt, ... ); | 35 void printf(const char* fmt, ... ); |
35 void memset(void* ptr, uint32_t value, uint32_t num); | 36 void memset(void* ptr, uint32_t value, uint32_t num); |
36 void memcpy(void* dst, void* src, uint32_t num); | 37 void memcpy(void* dst, void* src, uint32_t num); |
38 int strncmp(const char* s1, const char* s2, int size); | |
37 | 39 |
38 // Screen related: | 40 // Screen related: |
39 void clear_screen(); | 41 void clear_screen(); |
40 void init_screen(); | 42 void init_screen(); |
41 void print_string(const char *); | 43 void print_string(const char *); |
44 void set_cursor(int newrow, int newcol); | |
45 void get_cursor(int *therow, int *thecol); | |
46 void set_color(int forecolor, int backcolor); | |
42 | 47 |
43 // For IO ports: | 48 // For IO ports: |
44 uint8_t inb(uint16_t); | 49 uint8_t inb(uint16_t); |
45 uint16_t inw(uint16_t); | 50 uint16_t inw(uint16_t); |
46 void outb(uint16_t, uint8_t); | 51 void outb(uint16_t, uint8_t); |
52 // ASM helper: | 57 // ASM helper: |
53 void loadIDT(void); | 58 void loadIDT(void); |
54 | 59 |
55 // Panic exit: | 60 // Panic exit: |
56 void halt(void); | 61 void halt(void); |
62 void panic(char *msg); | |
57 | 63 |
58 // Bochs xchg bx,bx breakpoint: | 64 // Bochs xchg bx,bx breakpoint: |
59 void magicBochsBreak(); | 65 void magicBochsBreak(); |
60 | 66 |
61 // Assembler util functions: | 67 // Assembler util functions: |
62 void doCPUID(int eax, int *ebx, int *ecx, int *edx); | 68 void doCPUID(int eax, int *ebx, int *ecx, int *edx); |
63 | 69 |
64 // Keyboard driver: | 70 // Keyboard driver: |
65 void keyboardDriverUpdate(unsigned char scancode); | 71 void keyboardDriverUpdate(unsigned char scancode); |
72 void getline(char *buffer, int len); | |
73 | |
74 // Timer: | |
66 void timerDriverUpdate(void); | 75 void timerDriverUpdate(void); |
76 uint64_t getTimeMS(); | |
67 | 77 |
68 // Memory functions: | 78 // Memory functions: |
69 void mappage(uint64_t address); | 79 void mappage(uint64_t address); |
70 | 80 |
71 int querymode(void); | 81 int querymode(void); |
104 uint32_t baselow, basehigh; | 114 uint32_t baselow, basehigh; |
105 uint32_t lenlow, lenhigh; | 115 uint32_t lenlow, lenhigh; |
106 uint32_t type; | 116 uint32_t type; |
107 }; | 117 }; |
108 | 118 |
109 typedef struct { | 119 typedef struct |
120 { | |
110 char name[32]; // Name of the console | 121 char name[32]; // Name of the console |
111 unsigned char screendata[80*25]; // All chars in the console! | 122 unsigned char screendata[80*25]; // All chars in the console! |
112 } console_t; | 123 } console_t; |
113 | 124 |
114 typedef struct { | 125 typedef struct { |