3 #include <conio.h> /* this is where Open Watcom hides the outp() etc. functions */
12 #include <hw/cpu/cpu.h>
13 #include <hw/dos/dos.h>
14 #include <hw/flatreal/flatreal.h>
15 #include <hw/dos/doswin.h>
17 #include <hw/cpu/apiclib.h>
19 int main(int argc,char **argv) {
21 printf("APIC not detected. Reason: %s\n",apic_error_str);
25 printf("APIC base address: 0x%08lx\n",(unsigned long)apic_base);
26 printf("APIC global enable: %u\n",(unsigned int)(apic_flags&APIC_FLAG_GLOBAL_ENABLE?1:0));
27 printf("Read from bootstrap CPU: %u\n",(unsigned int)(apic_flags&APIC_FLAG_PROBE_ON_BOOT_CPU?1:1));
29 #if TARGET_MSDOS == 32
31 /* TODO: If LTP probe indicates we shouldn't assume physical<->linear addresses (i.e paging) then bail out */
35 if (!flatrealmode_setup(FLATREALMODE_4GB)) {
36 printf("Cannot enter flat real mode\n");
44 /* NTS: For safe access on Intel processors always read on 16-byte aligned boundary, 32-bit at all times.
45 * Intel warns the undefined bytes 4-15 between the regs are undefined and may cause undefined behavior. */
46 printf("APIC dump:\n");
47 for (i=0x0;i < 0x400;i += 16) {
51 printf("%08lx ",(unsigned long)apic_readd(i));