Buggy screen driver.
This commit is contained in:
@ -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);*/
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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
7
kernel/util.c
Normal 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
2
kernel/util.h
Normal file
@ -0,0 +1,2 @@
|
||||
#pragma once
|
||||
void memory_copy(char *src, char *dest, unsigned int n);
|
Reference in New Issue
Block a user