a. New getsw/setsr system calls for user land front panel access <trimmed>
The idea was that when debugging or wanting some feedback from a program, I can write directly to the display register with a putdr(v) in my program and switch the console to show the display register. Likewise, when needing to make a decision (verbose logging, for example) I can read the switches and check a switch setting to make the decision. So basically an excuse to play with the front panel :)
...
The addition to /usr/src/sys/machine/kern_pdp.c was:
digbyt[21] % diff kern_pdp.c.orig kern_pdp.c
27a28,47
> * Provide user access to PDP11 front panel display and switch registers
> */
> #define SW ((short *)0177570)
>
> pdpgetsw()
> {
> u.u_r.r_val1 = *SW;
> }
>
> pdpsetdr()
> {
> register struct a {
> int swval;
> } *uap = (struct a *)u.u_ap;
>
> *SW = uap->swval;
> }
>
> /*
To add the system calls, edit /usr/src/sys/init_sysent.c:
digbyt[26] % diff init_sysent.c.orig init_sysent.c
17a18,22
> /* 1.0 local additions - DRST */
>
> pdpgetsw();
> pdpsetdr();
>
256a262
> #if 0
257a264,266
> #else
> 1, pdpsetdr, /* 147 = set display register */
> #endif
269a279
> #if 0
270a281,283
> #else
> 0, pdpgetsw, /* 151 = get switch register */
> #endif
274a288,290
> #if 0
> 1, pdpsetdr, /* 156 = set display register */
> #endif
I havn't bothered adding the new calls to the C library yet. They can be accessed with the following trivial piece of assembler (fplib.s):
.globl _getsw,_setdr_getsw:sys 151.rts pc_setdr:sys 147.rts pc
Where 147 and 151 were the last two unused system call entries.
I put the results on my web site here if anyone wants to try it:
http://skaro.afraid.org:4280/software/bsd211
--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/a35f134c-5fd5-4466-ab2d-f3794284d8d9%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pid...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/e34cf89b-2a31-6beb-ae6d-c79dda0472a1%40softjar.se.
exec 3<>/dev/panel # open the front panel device for read/write as file descriptor 3read switches <&3 #assign switch values to $switches using default radixecho "77" >&3 # assign display register to 77 interpreted using current radix
echo "r20" >&3 # set radix to 16 (assuming current radix was 8)
read switches <&3 # get switch settings in hex
echo "f00" >&3 # write a hex value to the display register
echo "r0" >&3 # set current radix to 0 meaning binary
echo "r1" >&3
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/CABNE3iBwdAF7K57SLJeNC8ba%2BqDLHGx7sLSqZ%2Bo4EanJz6OPxg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pidp-11/7c8f77e6-a6fb-4b1e-bc4c-b3f74f7eb21c%40softjar.se.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pidp-11/4b95d97c-cf3e-4988-be06-a0035ea38275%40softjar.se.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pidp-11/9d2e1645-014d-4b2f-8103-88b975bc2879n%40googlegroups.com.