-
Notifications
You must be signed in to change notification settings - Fork 0
/
spede.h
35 lines (28 loc) · 1.58 KB
/
spede.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// spede.h, CpE/CSc159
// SPEDE library headers, ~spede2/Target-i386/Common/include/spede
#ifndef __SPEDE_H__
#define __SPEDE_H__
#include <spede/flames.h> // IO_DELAY(), breakpoint(), cons_putchar(), cons_getchar(), cons_kbhit(),
#include <spede/sys/cdefs.h> // __BEGIN_DECLS, __END_DECLS, etc.
#include <spede/stdio.h> // printf(), sprintf(), vprintf(), sscanf(), etc.
#include <spede/assert.h> // assert()
#include <spede/machine/io.h> // inportb(), outportb(), inportw(), etc.
#include <spede/machine/proc_reg.h> // get_idt_base(), get_cs(), set_cr3(), etc
#include <spede/machine/seg.h> // struct i386_gate, fill_gate(), etc.
#include <spede/machine/asmacros.h> // ASM(), CNAME(), ENTRY(), etc.
#include <spede/machine/parallel.h> // Printer, IRQ 7
#include <spede/machine/rs232.h> // Terminal, IRQ 3
#include <spede/string.h> // file system phase needs strtok()
// #include <spede/machine/pic.h> // IRQ_VECTOR(), IRQ_TIMER, IRQ_COM1, ICU0_IOBASE, SPECIFIC_EOI(), etc.
// #include <spede/stdlib.h> // TRUE, FALSE, NULL, etc.
// #include <spede/time.h> // CLK_TCK, time_t, clock(), time(), etc.
#endif // ifndef __SPEDE_H__
/* I/O port 0x80 is reserved and will never be used. If you
* access this port, you create a delay of three cycles at 8.33MHz,
* plus the I/O access, which takes two clock cycles (total of 5).
* An unmapped I/O port goes out to the ISA bus, which runs with
* a 8.33MHz clock. Especially true in PCI systems.
* Two of these in a row give a 1.2 microsecond delay.
* Attributed to James van Artsdalen.
*/
// #define IO_DELAY() ASM ("inb $0x80,%%al" : : : "eax")