#define SQUARE_WAVE 0x36 /* ccaammmb, a = access, m = mode, b = BCD */
/* 11x11, 11 = LSB then MSB, x11 = sq wave */
#define TIMER_FREQ 1193182 /* clock frequency for timer in PC and AT */
-#define TIMER_COUNT (TIMER_FREQ/HZ) /* initial value for counter*/
+#define TIMER_COUNT (TIMER_FREQ/system_hz) /* initial value for counter*/
/*===========================================================================*
* arch_init_clock *
* be made of the load average over variable periods, in the
* user library (see getloadavg(3)).
*/
- slot = (realtime / HZ / _LOAD_UNIT_SECS) % _LOAD_HISTORY;
+ slot = (realtime / system_hz / _LOAD_UNIT_SECS) % _LOAD_HISTORY;
if(slot != kloadinfo.proc_last_slot) {
kloadinfo.proc_load_history[slot] = 0;
kloadinfo.proc_last_slot = slot;
reg_t ktsb; /* kernel task stack base */
struct exec e_hdr; /* for a copy of an a.out header */
+ do_serial_debug=0;
+
/* Clear the process table. Anounce each slot as empty and set up mappings
* for proc_addr() and proc_nr() macros. Do the same for the table with
* privilege structures for the system processes.
rp->p_memmap[S].mem_len) << CLICK_SHIFT;
rp->p_reg.sp -= sizeof(reg_t);
}
+
+ /* If this process has its own page table, VM will set the
+ * PT up and manage it. VM will signal the kernel when it has
+ * done this; until then, don't let it run.
+ */
+ if(priv(rp)->s_flags & PROC_FULLVM)
+ RTS_SET(rp, VMINHIBIT);
/* Set ready. The HARDWARE task is never ready. */
if (rp->p_nr == HARDWARE) RTS_SET(rp, NO_PRIORITY);
*/
kprintf("MINIX will now be shut down ...\n");
tmr_arg(&shutdown_timer)->ta_int = how;
- set_timer(&shutdown_timer, get_uptime() + 5*HZ, minix_shutdown);
+ set_timer(&shutdown_timer, get_uptime() + system_hz, minix_shutdown);
}
/*===========================================================================*
if (strcmp(value, "ega") == 0) machine.vdu_ega = TRUE;
if (strcmp(value, "vga") == 0) machine.vdu_vga = machine.vdu_ega = TRUE;
+ /* Get clock tick frequency. */
+ value = get_value(params_buffer, "hz");
+ if(value)
+ system_hz = atoi(value);
+ if(!value || system_hz < 2 || system_hz > 50000) /* sanity check */
+ system_hz = DEFAULT_HZ;
+
/* Return to assembler code to switch to protected mode (if 286),
* reload selectors and call main().
*/
*/
size_t length;
vir_bytes src_vir;
- int proc_nr, nr_e, nr, hz;
+ int proc_nr, nr_e, nr;
struct proc *caller;
phys_bytes ph;
break;
}
case GET_HZ: {
- length = sizeof(hz);
- src_vir = (vir_bytes) &hz;
- hz = HZ;
+ length = sizeof(system_hz);
+ src_vir = (vir_bytes) &system_hz;
break;
}
case GET_IMAGE: {
case GET_WHOAMI: {
int len;
/* GET_WHOAMI uses m3 and only uses the message contents for info. */
- m_ptr->GIWHO_EP = who_e;
+ m_ptr->GIWHO_EP = caller->p_endpoint;
len = MIN(sizeof(m_ptr->GIWHO_NAME), sizeof(caller->p_name))-1;
strncpy(m_ptr->GIWHO_NAME, caller->p_name, len);
m_ptr->GIWHO_NAME[len] = '\0';