Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Sep 2009 17:56:33 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r197493 - head/sys/compat/x86bios
Message-ID:  <200909251756.n8PHuXMv035659@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Fri Sep 25 17:56:32 2009
New Revision: 197493
URL: http://svn.freebsd.org/changeset/base/197493

Log:
  - Reduce BIOS memory mapping.  We want 1MB of physical memory, not 12MB[1].
  - Remove CS and IP registers from x86bios.h.  They have no use for us.
  - Adjust register dump to make it little bit more useful for debugging.
  
  Submitted by:	paradox (ddkprog yahoo com)[1] (initial version)

Modified:
  head/sys/compat/x86bios/x86bios.c
  head/sys/compat/x86bios/x86bios.h

Modified: head/sys/compat/x86bios/x86bios.c
==============================================================================
--- head/sys/compat/x86bios/x86bios.c	Fri Sep 25 17:56:13 2009	(r197492)
+++ head/sys/compat/x86bios/x86bios.c	Fri Sep 25 17:56:32 2009	(r197493)
@@ -98,9 +98,10 @@ x86bios_intr(struct x86regs *regs, int i
 		return;
 
 	if (bootverbose)
-		printf("Calling real mode int 0x%x "
-		    "(ax=0x%04x bx=0x%04x cx=0x%04x dx=0x%04x)\n",
-		    intno, regs->R_AX, regs->R_BX, regs->R_CX, regs->R_DX);
+		printf("Calling int 0x%x (ax=0x%04x bx=0x%04x "
+		    "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n",
+		    intno, regs->R_AX, regs->R_BX, regs->R_CX,
+		    regs->R_DX, regs->R_ES, regs->R_DI);
 
 	mtx_lock_spin(&x86bios_lock);
 
@@ -111,9 +112,10 @@ x86bios_intr(struct x86regs *regs, int i
 	mtx_unlock_spin(&x86bios_lock);
 
 	if (bootverbose)
-		printf("Exiting real mode int 0x%x "
-		    "(ax=0x%04x bx=0x%04x cx=0x%04x dx=0x%04x)\n",
-		    intno, regs->R_AX, regs->R_BX, regs->R_CX, regs->R_DX);
+		printf("Exiting int 0x%x (ax=0x%04x bx=0x%04x "
+		    "cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n",
+		    intno, regs->R_AX, regs->R_BX, regs->R_CX,
+		    regs->R_DX, regs->R_ES, regs->R_DI);
 }
 
 void *
@@ -144,7 +146,7 @@ x86bios_init(void *arg __unused)
 	x86bios_emu.emu_outl = x86bios_emu_outl;
 
 	x86bios_emu.mem_base = (char *)pbiosMem;
-	x86bios_emu.mem_size = 1024 * 1024;
+	x86bios_emu.mem_size = MAPPED_MEMORY_SIZE;
 
 	memset(busySegMap, 0, sizeof(busySegMap));
 

Modified: head/sys/compat/x86bios/x86bios.h
==============================================================================
--- head/sys/compat/x86bios/x86bios.h	Fri Sep 25 17:56:13 2009	(r197492)
+++ head/sys/compat/x86bios/x86bios.h	Fri Sep 25 17:56:32 2009	(r197493)
@@ -54,7 +54,7 @@ union x86_register {
 };
 
 struct x86regs {
-	uint16_t		register_cs;
+	uint16_t		padding;	/* CS is unused. */
 	uint16_t		register_ds;
 	uint16_t		register_es;
 	uint16_t		register_fs;
@@ -70,7 +70,6 @@ struct x86regs {
 	union x86_register	register_bp;
 	union x86_register	register_si;
 	union x86_register	register_di;
-	union x86_register	register_ip;
 };
 
 typedef struct x86regs	x86regs_t;
@@ -102,7 +101,6 @@ typedef struct x86regs	x86regs_t;
 #define R_BP	register_bp.I16_reg.x_reg
 #define R_SI	register_si.I16_reg.x_reg
 #define R_DI	register_di.I16_reg.x_reg
-#define R_IP	register_ip.I16_reg.x_reg
 #define R_FLG	register_flags
 
 /* special registers */
@@ -110,11 +108,9 @@ typedef struct x86regs	x86regs_t;
 #define R_EBP	register_bp.I32_reg.e_reg
 #define R_ESI	register_si.I32_reg.e_reg
 #define R_EDI	register_di.I32_reg.e_reg
-#define R_EIP	register_ip.I32_reg.e_reg
 #define R_EFLG	register_flags
 
 /* segment registers */
-#define R_CS	register_cs
 #define R_DS	register_ds
 #define R_SS	register_ss
 #define R_ES	register_es
@@ -125,8 +121,8 @@ typedef struct x86regs	x86regs_t;
 #define SEG_OFF(x)	((x) & 0x0FFFF)
 #define FARP(x)		((le32toh(x) & 0xffff) + ((le32toh(x) >> 12) & 0xffff00))
 
-#define MAPPED_MEMORY_SIZE	0xc00000
-#define PAGE_RESERV		(4096*5)
+#define MAPPED_MEMORY_SIZE	(1024 * 1024)
+#define PAGE_RESERV		(4096 * 5)
 
 __BEGIN_DECLS
 void *x86bios_alloc(int count, int *segs);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909251756.n8PHuXMv035659>