~kris/9p

9hist

ref: 2dc8401e2377e3ce7bee5c57bfd504f71c406cd9 9hist/pc/vgamach32.c -rw-r--r-- 600 bytes
2dc8401e — David du Colombier Plan 9 from Bell Labs 1997-05-20 29 years ago
                                                                                
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
41
42
43
44
45
46
47
#include "u.h"
#include "../port/lib.h"
#include "mem.h"
#include "dat.h"
#include "fns.h"
#include "../port/error.h"

#include <libg.h>
#include "screen.h"
#include "vga.h"

static Lock mach32lock;

static void
mach32page(int page)
{
	uchar ae, p;

	lock(&mach32lock);

	p = (page & 0x0F)<<1;
	p |= (page & 0x07)<<5;
	outs(0x1CE, (p<<8)|0xB2);

	outb(0x1CE, 0xAE);
	ae = inb(0x1CE+1);

	p = (page>>4) & 0x03;
	p |= p<<2;
	p |= ae & 0xF0;
	outs(0x1CE, (p<<8)|0xAE);

	unlock(&mach32lock);
}

static Vgac mach32 = {
	"mach32",
	mach32page,

	0,
};

void
vgamach32link(void)
{
	addvgaclink(&mach32);
}