- if (reboot)
- {
- /*
- * Tell the BIOS not to clear and test memory.
- */
- if (!reset_mem_on_reboot)
- *(unsigned short *)phystokv(0x472) = 0x1234;
-
- printf("MACH Reboot\n");
- PEHaltRestart( kPERestartCPU );
- }
- else
- {
- printf("CPU halted\n");
- PEHaltRestart( kPEHaltCPU );
- }
- while(1);
-}
-
-/*
- * Basic VM initialization.
- */
-
-void
-i386_init(void)
-{
- int i,j; /* Standard index vars. */
- vm_size_t bios_hole_size;
-
-#ifndef __MACHO__
- /*
- * Zero the BSS.
- */
-
- bzero((char *)&edata,(unsigned)(&end - &edata));
-#endif
-
- boot_string = &boot_string_store[0];
-
- /*
- * Initialize the pic prior to any possible call to an spl.
- */
-
- set_cpu_model();
- vm_set_page_size();
-
- /*
- * Initialize the Event Trace Analysis Package
- * Static Phase: 1 of 2
- */
- etap_init_phase1();
-
- /*
- * Compute the memory size.
- */
-
-#if 1
- /* FIXME
- * fdisk needs to change to use a sysctl instead of
- * opening /dev/kmem and reading out the kernboot structure
- */
-
- first_addr = (char *)(KERNSTRUCT_ADDR) + sizeof(KERNBOOTSTRUCT);
-#else
-#if NCPUS > 1
- first_addr = 0x1000;
-#else
- /* First two pages are used to boot the other cpus. */
- /* TODO - reclaim pages after all cpus have booted */
-
- first_addr = 0x3000;
-#endif
-#endif
-
- /* BIOS leaves data in low memory */
- last_addr = 1024*1024 + extmem*1024;
-
- /* extended memory starts at 1MB */
-
- bios_hole_size = 1024*1024 - trunc_page((vm_offset_t)(1024 * cnvmem));
-
- /*
- * Initialize for pmap_free_pages and pmap_next_page.
- * These guys should be page-aligned.
- */
-
- hole_start = trunc_page((vm_offset_t)(1024 * cnvmem));
- hole_end = round_page((vm_offset_t)first_avail);
-
- /*
- * compute mem_size
- */
-
- if (mem_size != 0) {
- if (mem_size < (last_addr) - bios_hole_size)
- last_addr = mem_size + bios_hole_size;
- }
-
- first_addr = round_page(first_addr);
- last_addr = trunc_page(last_addr);
- mem_size = last_addr - bios_hole_size;
-
- avail_start = first_addr;
- avail_end = last_addr;
- avail_next = avail_start;
-
- /*
- * Initialize kernel physical map, mapping the
- * region from loadpt to avail_start.
- * Kernel virtual address starts at VM_KERNEL_MIN_ADDRESS.
- */
-
-
-#if NCPUS > 1 && AT386
- /*
- * Must Allocate interrupt stacks before kdb is called and also
- * before vm is initialized. Must find out number of cpus first.
- */
- /*
- * Get number of cpus to boot, passed as an optional argument
- * boot: mach [-sah#] # from 0 to 9 is the number of cpus to boot
- */
- if (wncpu == -1) {