Deleted Added
full compact
biosmem.c (43561) biosmem.c (53207)
1/*
2 * mjs copyright
1/*
2 * mjs copyright
3 *
4 * $FreeBSD: head/sys/boot/pc98/libpc98/biosmem.c 53207 1999-11-16 00:42:18Z nyan $
3 */
4
5/*
6 * Obtain memory configuration information from the BIOS
7 *
8 * Note that we don't try too hard here; knowing the size of
9 * base memory and extended memory out to 16 or 64M is enough for
10 * the requirements of the bootstrap.

--- 25 unchanged lines hidden (view full) ---

36
37/*
38 * Return extended memory size in kB
39 */
40int
41getextmem(void)
42{
43 int extkb;
5 */
6
7/*
8 * Obtain memory configuration information from the BIOS
9 *
10 * Note that we don't try too hard here; knowing the size of
11 * base memory and extended memory out to 16 or 64M is enough for
12 * the requirements of the bootstrap.

--- 25 unchanged lines hidden (view full) ---

38
39/*
40 * Return extended memory size in kB
41 */
42int
43getextmem(void)
44{
45 int extkb;
44
46
45#ifdef PC98
46 extkb = *(u_char *)PTOV(0xA1401)*128 + *(unsigned short *)PTOV(0xA1594)*1024;
47#else
48 v86.ctl = 0;
49 v86.addr = 0x15; /* int 0x15 function 0x88*/
50 v86.eax = 0x8800;
51 v86int();
52 extkb = v86.eax & 0xffff;
53#endif
47#ifdef PC98
48 extkb = *(u_char *)PTOV(0xA1401)*128 + *(unsigned short *)PTOV(0xA1594)*1024;
49#else
50 v86.ctl = 0;
51 v86.addr = 0x15; /* int 0x15 function 0x88*/
52 v86.eax = 0x8800;
53 v86int();
54 extkb = v86.eax & 0xffff;
55#endif
56
54 /* Set memtop to actual top or 16M, whicheve is less */
55 memtop = min((0x100000 + (extkb * 1024)), (16 * 1024 * 1024));
56
57 return(extkb);
58}
59
57 /* Set memtop to actual top or 16M, whicheve is less */
58 memtop = min((0x100000 + (extkb * 1024)), (16 * 1024 * 1024));
59
60 return(extkb);
61}
62