Buggy screen driver.

This commit is contained in:
Nicolás Ortega Froysa
2018-02-26 15:02:25 +01:00
parent 21c97f509d
commit ad43ca56b1
8 changed files with 109 additions and 15 deletions

View File

@ -1,10 +1,6 @@
#include "../drivers/screen.h"
void main() {
/*
* point to first text cell of the video memory
*/
char *video_memory = (char*) 0xb8000;
/*
* store the character 'X' there
*/
*video_memory = 'X';
/*clear_screen();
print_at("This is a test.", 0, 0);*/
}

View File

@ -1,4 +1,4 @@
unsigned char port_byte_in(unsigned char port) {
unsigned char port_byte_in(unsigned short port) {
unsigned char res;
/*
* `"=a" (res)' means: put result of `al' into `res' variable
@ -8,7 +8,7 @@ unsigned char port_byte_in(unsigned char port) {
return res;
}
void port_byte_out(unsigned char port, unsigned char data) {
void port_byte_out(unsigned short port, unsigned char data) {
__asm__("out %%al, %%dx" : : "a" (data), "d" (port));
}

View File

@ -3,11 +3,11 @@
/*
* return a byte from a port.
*/
unsigned char port_byte_in(unsigned char port);
unsigned char port_byte_in(unsigned short port);
/*
* write a byte of data to a port.
*/
void port_byte_out(unsigned char port, unsigned char data);
void port_byte_out(unsigned short port, unsigned char data);
/*
* return a word of data from a port.
*/

7
kernel/util.c Normal file
View File

@ -0,0 +1,7 @@
void memory_copy(char *src, char *dest, unsigned int n) {
unsigned int i;
for(i = 0; i < n; ++i)
{
dest[i] = src[i];
}
}

2
kernel/util.h Normal file
View File

@ -0,0 +1,2 @@
#pragma once
void memory_copy(char *src, char *dest, unsigned int n);