[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

i386 model bytes

I need to retrieve the i386 "model bytes" to do some special workarounds in
stand/libsa/gateA20.c for my funky IBM L40.  My L40 manual says, "the
location of the machine model bytes can be found through INT 15H function
code (AH) = hex C0."

Can anyone suggest a code snippet to retrieve the model bytes?  There are a
few examples of int 15 calls but I'm not enough of an assembler freak to
know how to modify them.  Here is one I found in apm_check().

	register u_int detail;
	register u_int8_t f;
	__asm __volatile(DOINT(0x15) "\n\t"
			 "setc %b1\n\t"
			 "movzwl %%ax, %0\n\t"
			 "shll $16, %%ecx\n\t"
			 "orl %%ecx, %0"
			 : "=a" (detail), "=b" (f)
			 : "%ecx", "cc");
	if (f || BIOS_regs.biosr_bx != 0x504d /* "PM" */ ) {