sets up the PIC

This commit is contained in:
2025-05-30 12:14:52 -04:00
parent b87738ca47
commit 0256466f4c
9 changed files with 184 additions and 5 deletions

View File

@ -1,24 +0,0 @@
#ifndef ARCH_IO_H
#define ARCH_IO_H
/**
* outb:
* Sends the given data to the I/O port. Defined in io.s
*
* @param port The I/O port to send the data to
* @param data TThe data to send to the I/O port
*/
void outb(unsigned short port, unsigned char data);
/**
* inb:
* Read a byte from an I/O port
*
* @param port The address of the I/O port
* @return The read byte
*/
unsigned char inb(unsigned short port);
#endif

View File

@ -18,3 +18,9 @@ inb:
in al, dx ; read a byte from the I/O port and store it in the al register
ret ; return the read byte
global io_wait
io_wait:
mov al, 0x0
out 0x80, al
ret

View File

@ -3,9 +3,7 @@
#include <string.h>
#include <kernel/serial.h>
#include "io.h"
#include <kernel/x86/io.h>
/* I/O ports */

View File

@ -4,9 +4,9 @@
#include <string.h>
#include <kernel/tty.h>
#include <kernel/x86/io.h>
#include "vga.h"
#include "io.h"
/* I/O ports */
#define VGA_COMMAND_PORT 0x3D4