~kris/9p

9hist

ref: 9f9f12b3fa4f2c529ed1e00a8b85fe1dce3f155c 9hist/pc/vgamach32.c -rw-r--r-- 532 bytes
9f9f12b3 — David du Colombier Plan 9 from Bell Labs 1996-08-08 30 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
#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 void
mach32page(int page)
{
	uchar ae, p;


	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);
}

static Vgac mach32 = {
	"mach32",
	mach32page,

	0,
};

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