Skip to content

Commit

Permalink
Initial "hello world" command block
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronJackson committed Jun 29, 2022
1 parent d06f803 commit 8269ce1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
26 changes: 24 additions & 2 deletions sys/pdpuba/sbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
#define NSBD 1

/*
* Default status register 0760010
* Default status register 0760040
* Default vector 0270 (PRI 4)
*/

struct sbddevice *sbd = (struct sbddevice *)0760010;
#define dev_t int

struct sbddevice *sbd = (struct sbddevice *)0760040;

sbdattach(addr, unit)
struct sbddevice *addr;
Expand All @@ -25,6 +27,26 @@ sbdopen(dev, flag)
dev_t dev;
short flag;
{
static int cmd[] = {
22, /* 22 bytes / 11 words */
(0 << 9) | SBD_FCPIX,
(0 << 9) | SBD_FCRUB,
(2 << 9) | SBD_FCALP,
0300, /* x coord */
0300, /* y coord */
06, /* 6 characters */
"eh",
"ll",
"!o",
-1
};

/* we can probably ignore bits above 16 i think? */
unsigned int addr = (unsigned int)cmd;

sbd->hahl = 0000376 & addr;
sbd->hahr = 0177400 & addr;
sbd->hcsr = 0;

return 0;
}
Expand Down
19 changes: 16 additions & 3 deletions sys/pdpuba/sbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,30 @@
*/

struct sbddevice {
char hcsr; /* Cmd and Status Register */
char hinv; /* Interrupt Vector */
char u0; /* Unused */
char hahr; /* Host Address High */
char hcsr; /* Cmd and Status Register */
char u1; /* Unused */
char hahl; /* Host Address Low */
char hahr; /* Host Address High */
char u2; /* Unused */
char hahl; /* Host Address Low */
char u3; /* Unused */
};

/* SBD Register Bitmasks */
#define SBD_INTEN_HCSR 0200 /* _ I _ _ _ _ _ _ */
#define SBD_READY_HCSR 0400 /* R _ _ _ _ _ _ _ */
#define SBD_HADDR_HCSR 0077 /* _ _ A A A A A A */
#define SBD_HADDR_HAHR 0377 /* A A A A A A A A */
#define SBD_HADDR_HAHL 0376 /* A A A A A A A _ */
#define SBD_ABORT_HAHL 0001 /* _ _ _ _ _ _ _ Q */

/* SBD Function Codes */
#define SBD_FCRUB 0006 /* Erase rectangle */
#define SBD_FCPIX 0014 /* Display pixel graphics area */
#define SBD_FCVEC 0027 /* Draw vector */
#define SBD_FCCIR 0032 /* Draw circle */
#define SBD_FCALP 0035 /* Display text on pixel area */
#define SBD_FCWIB 0046 /* Write image block */
#define SBD_FCRIB 0047 /* Read image block */

0 comments on commit 8269ce1

Please sign in to comment.