mirror of https://github.com/E-Almqvist/eOS
commit
af4411ef20
@ -0,0 +1,8 @@ |
|||||||
|
char* get_vga_charpos_pointer(unsigned int col, unsigned int row); |
||||||
|
void writechar(char c, unsigned int col, unsigned int row, int colorcode); |
||||||
|
void clear_screen(); |
||||||
|
void disable_cursor(); |
||||||
|
void set_cursor_pos(); |
||||||
|
void print(); |
||||||
|
void println(); |
||||||
|
void vga_init(); |
@ -0,0 +1,26 @@ |
|||||||
|
// Function to read a byte from port
|
||||||
|
unsigned char port_byte_in(unsigned short port) { |
||||||
|
unsigned char res; |
||||||
|
__asm__("in %%dx, %%al" : "=a" (res) : "d" (port)); |
||||||
|
|
||||||
|
return res; |
||||||
|
} |
||||||
|
|
||||||
|
// to write a byte to port
|
||||||
|
void port_byte_out(unsigned short port, unsigned char data) { |
||||||
|
__asm__("out %%al, %%dx" : :"a" (data), "d" (port));
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
// Read word from port
|
||||||
|
unsigned short port_word_in(unsigned short port) { |
||||||
|
unsigned short res; |
||||||
|
__asm__("in %%dx, %%ax" : "=a" (res) : "d" (port)); |
||||||
|
|
||||||
|
return res; |
||||||
|
} |
||||||
|
|
||||||
|
// write word to port
|
||||||
|
void port_word_out(unsigned short port, unsigned short data) { |
||||||
|
__asm__("out %%ax, %%dx" : :"a" (data), "d" (port)); |
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
unsigned char port_byte_in(); |
||||||
|
void port_byte_out(); |
||||||
|
|
||||||
|
unsigned short port_word_in(); |
||||||
|
void port_word_out(); |
Loading…
Reference in new issue