Subject: clock, powerdown, reboot & halt implemented
To: None <>
From: Darrin B. Jewell <>
List: port-next68k
Date: 02/02/1999 11:03:56
I spent some time working on the clock routines this
weekend.  The port no longer boots up at the epoch.
I also implemented powerdown, reboot and halt and passing
of command line args to the kernel.

This means that you can boot with the following flags:
  -s (boot in single user mode)
  -a (ask for root device)
  -d (start up in debugger)

Also, shutdown -p turns off the machine.
halt (or shutdown -h) will enter the next rom monitor
and reboot (or shutdown -r) will reboot the machine.

Unfortunately, it only successfully boot from a cold
power up.  If it tries to boot itself a second time without
powering down, it crashes trying to enter the buffer
cache buffers into the page table.  I don't know why
this happens, although I suspect that it relies on the
way something is initialized (or not initialized) at
powerup.  Any hints or ideas regarding this appreciated.

Meanwhile, I am now up to successfully probing the scsi
disk and trying to read the disklabel.  We might even
have hard disk support before too long.


Below is a log of the reboot and debug session:

# shutdown -r now
shutdown -r now
Shutdown NOW!
shutdown: [pid 17]
# Dec 31 23:44:30 shutdown: reboot by root: 

System shutdown time has arrived

About to run shutdown hooks...

Done running shutdown hooks.
syncing disks... done
unmounting / (
uvm_vnp_terminate(0xa93270): terminating active vnode (refs=2)
uvm_vnp_terminate(0xa6a7ec): terminating active vnode (refs=2)
xe0: stop not implemented

[ preserving 252752 bytes of netbsd a.out symbol table ]
Copyright (c) 1996, 1997, 1998, 1999
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 1.3I (GENERIC) #71: Tue Feb  2 10:48:38 EST 1999
NeXT/MC68040 CPU+MMU+FPU, 4k on-chip physical I/D caches
real mem  = 33546240
panic: pmap_enter_ptpage: PT page not entered
Stopped in  at  _Debugger+0x6:  unlk    a6
db> t
_Debugger(2704,2,421d000,0,18aedc) + 6
_panic(e0627,1000,0,fffffffe,1) + 52
_pmap_enter_ptpage(13d824,1000000) + 508
_pmap_enter(13d824,1000000,4363000,7,1) + b8
_cpu_startup(10e59c,4001000,d0,128,ffeffffc) + 14e
uvm_fault(0x11c2fc, 0xfffff000, 0, 0x1) -> 0x1
  type 8, code [mmu,,ssw]: 505
trap type 8, code = 505, v = fffffffb
kernel: MMU fault trap
Caught exception in ddb.
_main() + 52