-
Notifications
You must be signed in to change notification settings - Fork 4
/
int32.h
40 lines (31 loc) · 1.04 KB
/
int32.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
36
37
38
39
40
// define our structure
typedef struct __attribute__ ((packed)) {
unsigned short di, si, bp, sp, bx, dx, cx, ax;
unsigned short gs, fs, es, ds, eflags;
} regs16_t;
// Map some lowmem pages for BIOS call purposes. The implementations of these live in vm.c for now.
pte_t biosmap();
void biosunmap(pte_t original);
// tell compiler our int32 function is external
extern void int32(unsigned char intnum, regs16_t *regs);
extern void bios_int(unsigned char intnum, regs16_t* regs);
// int32 test
/*void int32_test()
{
int y;
regs16_t regs;
// switch to 320x200x256 graphics mode
regs.ax = 0x0013;
int32(0x10, ®s);
// full screen with blue color (1)
memset((char *)0xA0000, 1, (320*200));
// draw horizontal line from 100,80 to 100,240 in multiple colors
for(y = 0; y < 200; y++)
memset((char *)0xA0000 + (y*320+80), y, 160);
// wait for key
regs.ax = 0x0000;
int32(0x16, ®s);
// switch to 80x25x16 text mode
regs.ax = 0x0003;
int32(0x10, ®s);
}*/