code provided by Mike Smith. While I'm here, convert this file to use
macros from <machine/asm.h> rather than making assumptions about how
C labels are handled.
sane in general. Since we can uniquely identify each SPU type
(except for 318/319/330, because there _are_ no differences, really),
require that the appropriate SPU option be configured into the kernel.
in new hp300spu.h file. This includes the code that associates
model number with cpu/mmu/cache combinations.
- Define "mmuid" constants for several models, derived from code
provided by Mike Smith.
systems with a Frodo Utility Chip. This is essientially an 8250 with
3 bytes of padding between each register. From mike smith
<miff@spam.frisbee.net.au>.
- place all interrupt-related macros, prototypes, etc. into <machine/intr.h>,
like other ports.
- rename isrlink/isrunlink/isrinit, etc. intr_establish/intr_disestablish/
intr_init, etc., and move to intr.c for naming consistency.
- don't call intr_init() twice.
- While servicing an rx, tx, or modem status interrupt: if we have a
NULL struct tty * or if the tty isn't open, just return.
- Skip the self test if we are the console; it manages to do funny
things to autoconfig messages. (XXX - this should be fixed)
code. In practice, no one traces NetBSD programs with HP-UX debuggers,
and the evil required to make it work should not be discussed in the
presence of small children.
- /dev/kmem: disallow access to devices
This is designed to protect device registers from being corrupted
accidentally by "innocent" mem/kmem grovellers.
- Supply an `fputype' global. Since all hp300's have an FPU, default
it to FPU_68881, setting it to FPU_68040 if we detect a 68040 CPU.
- Use `fputype' at run-time rathern than FPCOPROC at compile-time.
- Re-arrange locore slightly; move startup code to the beginning, right
after the vector table.
Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.
For the detailed change history, look at the commit log entries for
the is-newarp branch.
it fails spectacularly and doesn't clean up. Also, don't depend genassym.c
(since it no longer exists), and remove dependencies for genassym.o (since it
no longer exists).
compute the number of iterations through the copy loop based
on file size; the miniroot image may be compressed. Instead,
ignore short reads in the NFS case, and handle them like EOF.
- Fix typo in a printf format.
new ipl is higher than the ipl currently set in SR. (Thanks to
scottr@netbsd.org for implementing it while I was busy with other stuff!)
- Define spl{bio,net,tty,imp} in terms of _splraise().
- Move definition of splhil() here, and define splkbd() as an alias for it.
- Synch the "clean" rule with the i386 port's.
- Add a commented-out rule for generating assym.h w/ the new genassym.sh.
Some slight changes need to be made to genassym.h to make it work with
m68k, so we can't use it just yet.
The boot blocks do a primitive form of autoconfiguration. Duplicate some
of the old config strcutures for the benefit of the boot blocks; they
don't need something as flexible as the kernel does.
- Always ensure that RAW_PART ("c") can be opened.
- Disallow unused or non-existent partitions from being opened.
- Don't do bounds checking or partition translation on RAW_PART.
This is consistent with other disk drivers in the NetBSD source tree,
and fixes a condition where the user could not fix a corrupted disklabel
due to a bogus offset for partition "c".
- Always allow RAW_PART to be opened, regardless of the partition table.
- Never do partition translation on RAW_PART; it's always offset 0.
- Always make sure the disklabel is read from RAW_PART.
- Make *strategy() return values consistent.
This fixes a condition where a bogus partition table could be written
to the disk from SYS_INST, and the user had no way to rewrite with
a correct partition table, since RAW_PART would be invalid.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.
New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
dmacomputeipl(), which is called by drivers which use DMA once they've
hooked up their interrupts. This new function computes the appropriate
ipl to use for the DMA controller and (re-)establishes it's interrupt.
on indirect-config busses a (permanent) softc that they could share
between 'match' and 'attach' routines:
Define __BROKEN_INDIRECT_CONFIG so that old autoconfiguration
interfaces are used, until drivers are converted to use the new
interfaces (actually, converted back to use the _older_ interfaces)
which prohibit indirect configuration devices from receiving a softc
in their match routine that they can share with their attach routine.
Lets users over-ride with makeoptions COPTS="..." in kernel config files.
Leave `mandatory' flags (like -msoft-float which on m68k enforces no
FP in kernel) in CFLAGS.
VM_PROT_READ|VM_PROT_EXECUTE. The previous default (VM_PROT_ALL)
would cause the following scenario:
- someone attempts to write kernel text (my test was writing
to an offset of /dev/kmem which was known to be in the text
segment, while in single-user mode).
- enter trap() with MMU fault (because of RO pte).
- trap() calls vm_fault(), which looks up vm_map_entry for
fauling address.
- vm_fault interprets write fault and VM_PROT_WRITE (in VM_PROT_ALL)
as COW; new page allocated, data copied to new page, new page
mapped in at trunc_page(<faulting va>).
- wow, look at the fireworks!
Fixes two potential symptoms:
- kernacc() returns TRUE when checking for permission to write
an offset in kernel text, which is bogus, since the text has
been mapped RO by pmap_bootstrap().
- Handling of a stray pointer that attempted to scribble into
kernel text would not be executed properly.
don't do this, kernacc() will bogusly return TRUE for page 0, causing a
NULL pointer dereference in uiomove() when reading /dev/kmem.
Thanks to Scott Reynolds for noticing the problem.
- Fix up usage of MBD_ISPID().
- Ensure that we never deal with a NULL proc, and if our proc has
no pcb, punt. Suggested by Gordon Ross.
- Eliminate some redundant NULL pointer checks in the T_MMUFLT cases;
proc0.p_addr is now initialized early, and we make a single test
for sanity at the top of trap() now.
- Initialize proc0.p_addr just after setting up the kernel stack, to avoid
getting NULL pointers in trap(). Change suggested by Gordon Ross.
- Panic if main() returns.
- Tidy up a couple of comments.
(remaps page read/write/cache-inhibit, does write, restores previous
mapping). Kernel text no longer needs to be read/write with DDB/KGDB
is in the kernel.
Based on a similar module written for the Sun3 port by Gordon Ross,
and modified somewhat by me.
- Offset kernel text one page. Stash the PA of this offset page for
use later.
- Add a few comments.
- Free up some registers earlier in the initialization process.
- Use a `prototc' to set the Translation Control register, rather
than relying on a2 pointing just past the MMU trampoline in the
high page. (Suggested by Charles Hannum.)
- Set VBR to the kernel vector table just before turning on the MMU.
- Just before rebooting, set VBR to 0, which is what the BOOTROM expects
it to be.
kernel setroot(). The device type for network boot is set like any
other device now. Also, call the punit entry point for device drivers
to properly set `bootdev'.
The "options GENERIC" entry in kernel config files is not longer necessary
for "swap generic" kernels. Uses new config constructs which work with
some glue in an old config environment. This code will support new config
with minimal changes.
an unrecognized keyboard produced garbage on keypresses in the kernel,
but worked in the boot program (which has this default). The bug is
that the keymap pointers are unitialized.
- Only pass user trace traps and breakpoints on to trap().
Gets rid of some hair in the trace/breakpoint trap cases.
- Before entering the debugger, switch to a temporary
stack so that the debugger can alter the stack pointer.
- Add glue for KGDB (still not complete).
Some other minor cleanup:
- Protect against some bad pointer derefs.
- Be more a little more verbose when a fatal trap
occurs to aid debugging.
- Only pass user trace traps and breakpoints on to trap().
- Before entering the debugger, switch to a temporary
stack so that the debugger can alter the stack pointer.
- Add glue for KGDB (still not complete).
Clearly mark the MMU enable trampoline code.
the keyboard to work. Fixes a bug where booting with `-d' worked
only on systems using a serial console.
While I'm here, eliminate some redundancy in the ite console intialization
code.
This fixes a critical bug where a clock interrupt would happen sometime
between the call to hp300_calibrate_delay() and when proc0 is initialized.
This ends up dereferencing a bad pointer in itimerdecr(), which scribbles
over the first page of kernel text, specifically vectors 46 and 47 (decimal).
To complicate matters, the way the bug manifested itself was different
depending on whether or not DDB was configured into the kernel. When
DDB is in the kernel, kernel text is mapped read/write. When DDB is not
in the kernel, kernel text is mapped read-only. Note that the kernel
scribble happens early, typically before the console is initialized.
In the non-DDB case, the kernel will hang as soon as it's loaded because
the access causes a fault (before the console is initialized, so you
don't see the trap).
In the DDB case, the access does _not_ cause a fault. However, the
mechanism used to enter the kernel debugger is to issue a "trap #15".
Conveniently, this is one of the corrupted vectors (47), thus rendering
DDB useless (it actually caused a recursive panic/trap loop).
This _WILL_ be in the first 1.2 official patch.
* SunOS glue
* 68060 exception frame size definitions
* 68060 fault detection macros
- Use `cputype' rather than `mmutype' where appropriate.
- Play the prototype game.
This file is much closer to being sharable by all m68k ports.
* Make S expand to an absolute path at compile time.
* Use `-S' rather than `-x' to remove debugging symbols.
* Garbage collect unused variables.
* Reverse a handful of port-specific changes that do not correspond to
the common build model and are not needed.
a boot string for firmware that can do this, such as the SPARC and
the sun3 models. It is currently silently ignored on all other
hardware now, however. The MD function "boot()" has been changed to
also take a char *.
- Good bye SYS_PBOOT and SYS_NBOOT, hello SYS_UBOOT (unified boot)
Currently supports booting from SCSI and HP-IB disk and network
from a single boot block. Infrastructure for booting from
HP-IB tape is there, but it doesn't quite work yet.
- Add a slightly modified version of Gordon Ross's "rawfs",
which provides a filesystem-like interface to tape devices.
Still needs debugging (see above).
- Rename sys_inst.c to inst.c, so that the LIF directory entry
turns out right (used to look like SYS_SYS_I if loaded from
tape).
- Add a "netio_ask" hint to netio.c, so that a special instnetio.o
doesn't have to be compiled for SYS_INST. Defaults to using
bootparams, but if set, will prompt user for information
usually obtained from bootparams.
- General cleanup.
- New delay() function, modeled after sun3/mvme68k delay,
calibrated with a model's known cpu speed.
- Use the defined constants for machineid and ectype
when determining what kind of machine we have, rather
than their expanded equivalents, for clarity.
- Move the vector table to the data segment so that it
can be patched at run-time.
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.
Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
remove their 'integrate' (usually defined to be 'static') keywords.
when lance drivers are split up by attachment, more than one file will
reference the copy/zero functions (i.e. not just the file that pulls in
am7990.c... and eventually inclusion of am7990.c should go away entirely).
execpt without quotes. meant to be __CONCAT()ted for easy #includes
of machine-dependent headers for MI code (e.g. for the MI ISA/EISA/PCI/TC
bus code).
outside of "internal i/o" space to not even have a chance at console-hood.
Fix tested by Thorsten Frueauf <frueauf@ira.uka.de>, and offered with
my sincerest apologies that the bug ever existed in the first place.
a dca-specific constant. For now, hardwire standalone DCA console
at select code 9 (which is what the old constant expanded to). Really
should make the way the bootblock console is probed look just like how
the kernel console is probed.
- Interrupt service routines now take a pointer to
the device's softc, rather than a unit number.
- Interrupt handling code in locore.s condensed. Only
remaining "special" handlers are lev0 (spurious),
lev1 (HIL; don't ask), lev6 (clock), and lev7 (NMI).
Only remaining hard-coded device driver reference in
locore is HIL. (clock doesn't count...)
- "dcafastservice" eliminated. DCA driver has new mechanism
to guarantee prompt interrupt service at any ipl (not
just level 5).
- Interrupt code pulled out of autoconf.c and machdep.c and
placed in new file, isr.c
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.
YAY! No more need for dcafastservice!
HIL: squish instances of "(void) splhil()" and "(void) spl0();".
intent for the value of the C_REL constant was 0xc0. Testing has turned
up no adverse effect on tape or disk devices, and in fact this change
apparently makes my 9145 tape work as expected. (!) Closes PRs 1874 and
1971.
to the identification request in rdmatch(). Similar in spirit to a
patch from Jason Downs (written eons ago), but limited to the broken
device we're trying to reach. My patch tested (and fixed :-) by
Herb Peyerl.
- New metrics handling. Metrics are now kept in the new
`struct disk'. Busy time is now stored as a timeval, and
transfer count in bytes.
- Storage for disklabels is now dynamically allocated, so that
the size of the disk structure is not machine-dependent.
- Several new functions for attaching and detaching disks, and
handling metrics calculation.
Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.
For usage and architectural details, see the forthcoming disk(9) manual
page.
A fair bit of this, the m68k core dump and exec goo, can probably be
made into a generic m68k hpux module, eventually.
More to be placed in hpux_machdep.c - keep your eyes peeled...
squished into an 8-bit position in a command stream! Which one is wrong?
Changed the constant from 0x140 to 0x40, which is what ended up happening
anyhow. This exists in the old Utah sources, too! How long has this
bug existed?!
and LE_RINT_HOOK to blink the "LAN transmit" and "LAN receive" LEDs on
the front panels of 400-series machines iff the CPP symbol USELEDS is
defined in the kernel config file.
seem to really hurt anything, either. Makes it easier for folks using
binary snapshots only to try it out.
GENERIC: now that the PT map allocation is fixed, increase the default
maxusers to 32.
properties such as "M68040" and "M68K_MMU_MOTOROLA", used to conditionally
compile code. This is more in-line with now the other m68k ports do it,
and makes it much easier to find "common ground" among them.
In locore.s, use the MMU-type constants defined my <machine/cpu.h> rather
than "expanded" values.
Because HP300-model names are mapped to CPU/MMU combinations in
<machine/cpu.h>, no change to kernel configuration will be necessary.
allocated, as noticed by Chuck Cranor. In addition to re-arranging
the assignment as suggested by Niklas Hallqvist, check to see if maxproc
is higher than the number of available user PTs. If it is, lower maxproc
to that value, the rationale being that it's much more desirable to have
fork() return EAGAIN than to have your system wedge.
XXX note that root can still raise maxproc with sysctl(2) later. It's
probably worth having further discussion about this issue, but until
everyone has time to think about it, this seems like an acceptable solution
for the time being.
This is a step towards getting the drivers ready for new config.
Clean up namespace, remove several instances of global arrays. Instead,
use a softc to carry state around. Where possible, pass a pointer to
the softc rather than a unit number.
Pointers to hardware and software constructs are now stored per port
in each instance of the softc (one softc per board) rather than indexed
by minor number.
This is a step towards getting the drivers ready for new config.
Clean up namespace, remove several instances of global arrays. Instead,
use a softc to carry state around. Where possible, pass a pointer to the
softc rather than a unit number.
bit is set. Works around the fact that the last process to have the
console open exits, the bit is cleared, and "syncing disks...", etc. is
not seen if the system is rebooted with reboot(8). Fixes PR #1455.
COMPAT_NOLABEL.
XXX One day when the world doesn't assume DEV_BSIZE bytes/sector, we'll be
able to actually use the stuff sensed from the drive, rather than a table.
be done. Set up a structure filled with function pointers in the
controller-specific probe routines, and jump through them, instead of
if()'ing our way though each operation.
Be a little more discriptive; print out the controller type found
during the probe in a way that's somewhat meaningful.
* Reset the card on "fresh open" as a sanity measure.
* Use the "secret bit" to enable interrupts.
* Make some parts look/behave like their cousins in dev/isa/com.c
* Set the FIFO threshold based on line speed.
* Be a little more informative when port is attached.
* Implement TIOC{G,S}FLAGS; ttyflags now works.
First two items prevent deadlock on some systems (notably the 380,
425, and 433) which some people have been reporting. Use of the
"secret bit" seems to be safe on systems which don't need it. Changes
tested on a 319, 340, 345, and 380.
* Implement TIOC{G,S}FLAGS; ttyflags works now.
* Reset the card on a "fresh open" as a sanity measure.
* Make dcmopen() and dcmclose() a little more like the
corresponding routines in the new dca.c
* Prompt user for disklabel information and label disk.
* Copy miniroot image from NFS server to `b' partition.
* Boot kernel in miniroot image into single-user mode.
Hooks for tape support are there, but the meat for that isn't implemented yet.