Import backup from 2004-03-10

This commit is contained in:
josh committed 2017-07-25 22:23:46 -04:00
1 parent 7f886e44e1
commit 302538b8ff
24 files changed
+799 -694

No files matched your search

+1
View File
@@ -5,6 +5,7 @@
#include "hos_defines.h"
#include "cmos.h"
#include "sys/io.h"
//Returns the cmos type of floppy disk drive 0 (0 = not present)
unsigned char cmos_getfd0()
+6 -6
View File
@@ -8,24 +8,24 @@
#include "hos_defines.h"
inline void outportb(unsigned int port, unsigned char value);
inline void outportw(unsigned int port, unsigned int value);
inline unsigned char inportb(unsigned short port);
//void outportb(unsigned int port, unsigned char value);
//inline void outportw(unsigned int port, unsigned int value);
//inline unsigned char inportb(unsigned short port);
//Writes a byte out to a port
inline void outportb(unsigned int port, unsigned char value) // Output a byte to a port
static inline void outportb(unsigned int port, unsigned char value) // Output a byte to a port
{
asm volatile ("outb %%al,%%dx"::"d" (port), "a" (value));
}
//Writes a word out to a port
inline void outportw(unsigned int port, unsigned int value) // Output a word to a port
static inline void outportw(unsigned int port, unsigned int value) // Output a word to a port
{
asm volatile ("outw %%ax,%%dx"::"d" (port), "a" (value));
}
//Reads a byte from a port
inline unsigned char inportb(unsigned short port)
static inline unsigned char inportb(unsigned short port)
{
unsigned char ret_val;
+1
View File
@@ -4,6 +4,7 @@
#include "hos_defines.h"
#include "pic.h"
#include "sys/io.h"
//Re-maps the Programmable Interrupr Controllers so IRQ0->pic1 base address, IRG8->pic2 base address
void pic_remap(int pic1, int pic2)
+11 -10
View File
@@ -2,11 +2,12 @@
// Author: Josh Holtrop
// Created: 02/26/04
#include "hos_defines.h"
#ifndef __HOS_PIC__
#define __HOS_PIC__ __HOS_PIC__
#include "hos_defines.h"
#include "sys/io.h"
#define PIC1 0x20
#define PIC2 0xA0
#define PIC1_COMMAND PIC1
@@ -28,32 +29,32 @@
#define ICW4_SFNM 0x10 /* Special fully nested (not) */
void pic_remap(int pic1, int pic2);
inline void pic_mask1(byte mask);
inline void pic_mask2(byte mask);
inline void pic_eoi();
inline void pic_eoi2();
//inline void pic_mask1(byte mask);
//inline void pic_mask2(byte mask);
//inline void pic_eoi();
//inline void pic_eoi2();
//Masks interrupts on first Programmable Interrupt Controller
inline void pic_mask1(byte mask)
static inline void pic_mask1(byte mask)
{
outportb(PIC1_DATA, mask); //0x21, maskfield *OCW1*
}
//Masks interrupts on second Programmable Interrupt Controller
inline void pic_mask2(byte mask)
static inline void pic_mask2(byte mask)
{
outportb(PIC2_DATA, mask); //0xA1, maskfield *OCW1*
}
//Signals an End Of Interrupt signal to the first PIC
inline void pic_eoi()
static inline void pic_eoi()
{
outportb(0x20, 0x20);
}
//Signals an End Of Interrupt signal to both the second and first PIC unit
inline void pic_eoi2()
static inline void pic_eoi2()
{
outportb(0xA0, 0x20);
outportb(0x20, 0x20);
+1
View File
@@ -7,6 +7,7 @@
#include "hos_defines.h"
#include "rtc.h"
#include "sys/io.h"
unsigned char rtc_readDay()
{