* 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.
register unsigned int *adx
;
while((c
= *fmt
++) != '%') {
printx((long)*adx
, trace
);
else if (c
== 'd' || c
== 'u' || c
== 'o' || c
== 'x')
printn((long)*adx
, c
=='o'? 8: (c
=='x'? 16:10), trace
);
if (trcbufp
>= &trcbuf
[TRCBUFS
]) {
printn(*(long *)adx
, 10, trace
);
adx
+= (sizeof(long) / sizeof(int)) - 1;
putchar("0123456789ABCDEF"[(x
>>((7-i
)*4))&0xf], trace
);
* Print an unsigned integer in base b.
if (n
<0) { /* shouldn't happen */
putchar("0123456789ABCDEF"[(int)(n
%b
)], trace
);
* Panic is called on unresolvable
* It syncs, prints "panic: mesg" and
printf("panic: %s\n", s
);
* 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 %u/%u\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\n", bp
->b_blkno
, o1
,o2
);
if (nch
< 0 || nch
> TRCBUFS
)
pos
= (trcbufp
- trcbuf
) - nch
;
for (cp
= &trcbuf
[pos
]; nch
> 0; nch
--) {
if (cp
>= &trcbuf
[TRCBUFS
])
char *msgbufp
= msgbuf
; /* Next saved printf character */
* Print a character on console or in internal trace buffer.
* If destination is console then the last MSGBUFS characters
* are saved in msgbuf for inspection later.
if (trcbufp
>= &trcbuf
[TRCBUFS
]) {
if (c
!= '\0' && c
!= '\r' && c
!= 0177) {
if (msgbufp
>= &msgbuf
[MSGBUFS
])