Finished 02_driver: Moved X to VGA Location.
This commit is contained in:
parent
3a3be79bae
commit
ccd9c75f8e
BIN
Part2/.DS_Store
vendored
BIN
Part2/.DS_Store
vendored
Binary file not shown.
BIN
Part2/A4/.DS_Store
vendored
BIN
Part2/A4/.DS_Store
vendored
Binary file not shown.
BIN
Part2/A4/02_driver/.DS_Store
vendored
BIN
Part2/A4/02_driver/.DS_Store
vendored
Binary file not shown.
@ -9,11 +9,11 @@ void _start() {
|
||||
position = position << 8; /* high byte */
|
||||
|
||||
port_byte_out(0x3d4, 15); /* requesting low byte */
|
||||
position += port_byte_in(0x3d5);
|
||||
position += port_byte_in(0x3d5) + 250;
|
||||
|
||||
/* VGA 'cells' consist of the character and its control data
|
||||
* e.g. 'white on black background', 'red text on white bg', etc */
|
||||
int offset_from_vga = position * 2.3;
|
||||
int offset_from_vga = position * 2;
|
||||
|
||||
/* Now you can examine both variables using gdb, since we still
|
||||
* don't know how to print strings on screen. Run 'make debug' and
|
||||
@ -27,6 +27,6 @@ void _start() {
|
||||
/* Let's write on the current cursor position, we already know how
|
||||
* to do that */
|
||||
char *vga = (char *) 0xb8000;
|
||||
vga[offset_from_vga+10] = 'X';
|
||||
vga[offset_from_vga+11] = 0x0f; /* White text on black background */
|
||||
vga[offset_from_vga] = 'X';
|
||||
vga[offset_from_vga+1] = 0x0f; /* White text on black background */
|
||||
}
|
||||
|
BIN
Part2/A4/06_irq/.DS_Store
vendored
BIN
Part2/A4/06_irq/.DS_Store
vendored
Binary file not shown.
Reference in New Issue
Block a user