* In case console is off,
* panicstr contains argument to last
* Scaled down version of C Library printf.
* Only %s %u %d (==%u) %o %x %D are recognized.
* Used to print diagnostic information
* directly on console tty.
* Since it is not interrupt driven,
* all system activities are pretty much
* Printf should not be used for chit-chat.
* print to the current users terminal,
* guarantee not to sleep (so can be called by intr routine)
* no watermark checking - so no verbose messages
/* THIS CODE IS VAX DEPENDENT */
while ((c
= *fmt
++) != '%') {
case 'u': /* what a joke */
/* END VAX DEPENDENT CODE */
if (b
== 10 && (int)n
< 0) {
*cp
++ = "0123456789abcdef"[n
%b
];
* Panic is called on unresolvable fatal errors.
* It syncs, prints "panic: mesg", and then reboots.
printf("panic: %s\n", s
);
boot(RB_PANIC
, RB_AUTOBOOT
);
* prdev prints a warning message of the
* form "mesg on dev x/y".
* x and y are the major and minor parts of
printf("%s on dev %d/%d\n", str
, major(dev
), minor(dev
));
* deverr prints a diagnostic from
* It prints the device, block number,
* and an octal word (usually some error
* status register) passed as argument.
printf("bn=%d er=%x,%x", bp
->b_blkno
, o1
,o2
);
* Print a character on console or users terminal.
* If destination is console then the last MSGBUFS characters
* are saved in msgbuf for inspection later.
register struct tty
*tp
= u
.u_ttyp
;
if (tp
&& (tp
->t_state
&CARR_ON
)) {
if (c
!= '\0' && c
!= '\r' && c
!= 0177) {
if (msgbuf
.msg_magic
!= MSG_MAGIC
) {
msgbuf
.msg_magic
= MSG_MAGIC
;
if (msgbuf
.msg_bufx
< 0 || msgbuf
.msg_bufx
>= MSG_BSIZE
)
msgbuf
.msg_bufc
[msgbuf
.msg_bufx
++] = c
;