[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
i386 model bytes
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: i386 model bytes
- From: Jim Rees <rees_(_at_)_umich_(_dot_)_edu>
- Date: Tue, 30 Jun 1998 18:32:38 -0400
- Delivery-date: Tue Jun 30 15:33:34 1998
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)
: "0" (APM_INSTCHECK), "1" (APM_DEV_APM_BIOS)
: "%ecx", "cc");
if (f || BIOS_regs.biosr_bx != 0x504d /* "PM" */ ) {
...
Visit your host, monkey.org