mirror of
https://github.com/DoctorWkt/pdp7-unix.git
synced 2026-02-04 07:43:27 +00:00
I've restructured the alternative version of PDP-7 Unix so that the
source code is now in src/alt. All the files in src/sys and src/cmd are only annotated versions of the files in scans/. The build/Makefile has been updated so that it can build the original PDP-7 Unix or the alternative version. Phil has fixed the Graphics-2 code, so that there is no need to have any #ifdef code in the original kernel.
This commit is contained in:
@@ -124,11 +124,7 @@ login:
|
||||
2:
|
||||
lac nchar
|
||||
sys setuid " Set the user's user-id
|
||||
#ifdef NO_DD
|
||||
sys chdir; dotdot " Change into the root directory (out of system)
|
||||
#else
|
||||
sys chdir; dd " Change into the "dd" directory
|
||||
#endif
|
||||
sys chdir; dir " and then the user's home directory
|
||||
|
||||
lac d2 " Close file descriptor 2
|
||||
@@ -253,8 +249,6 @@ m3:
|
||||
m3s = .-m3
|
||||
dd:
|
||||
<dd>;040040;040040;040040
|
||||
dotdot:
|
||||
<..>;040040;040040;040040
|
||||
dir:
|
||||
040040;040040;040040;040040
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#Readme
|
||||
|
||||
This area is a place to write and try out kernel-mode test code. We can
|
||||
try out drivers, test the disk routines etc. The idea is to bring pieces
|
||||
of the real kernel in, test them, and keep incorporating stuff until we
|
||||
reach a working kernel.
|
||||
|
||||
List filenames and comments here.
|
||||
@@ -1,71 +0,0 @@
|
||||
" Code to test the teleprinter output. Some code borrowed from s7.s
|
||||
|
||||
iof = 0700002 " PIC: interrupts off
|
||||
ion = 0700042 " PIC: interrupts on
|
||||
tsf = 0700401 " TTY: skip if flag set
|
||||
tcf = 0700402 " TTY: clear flag
|
||||
tls = 0700406 " TTY: load buffer, select
|
||||
|
||||
. = 020
|
||||
|
||||
iof " Interrupts off, do we need this?
|
||||
|
||||
1: tsf " Is the teleprinter ready to print?
|
||||
jmp 1b " No, loop back
|
||||
|
||||
tcf " Clear the ready flag
|
||||
jms ttyrestart " Print out a character
|
||||
hlt " and halt for now
|
||||
|
||||
|
||||
ttyrestart: 0
|
||||
lac ttydelay " Is the ttydelay positive?
|
||||
spa
|
||||
jmp ttyrestart i " Yes, can't print the character yet
|
||||
lac nttychar
|
||||
dzm nttychar
|
||||
sza
|
||||
jmp 3f
|
||||
isz ttydelay " Increment the tty delay towards zero
|
||||
lac d2 " Why 2?
|
||||
jms getchar " Get a character to print
|
||||
jmp 2f " Why the jump, does getchar skip? Yes if no char
|
||||
3:
|
||||
tls " Send the character to the teleprinter
|
||||
sad o12
|
||||
jms putcr " It's a newline, also send a CR?
|
||||
sad o15
|
||||
skp " It was CR, so now insert a delay
|
||||
jmp ttyrestart i " Not CR, so return from the routine
|
||||
|
||||
lac ttydelay " Add 020 to the ttydelay
|
||||
tad o20
|
||||
rcr " Rotate right once
|
||||
cma " Invert the AC
|
||||
dac ttydelay " and save back in ttydelay
|
||||
jmp ttyrestart i " Now return from the routine
|
||||
2:
|
||||
" lac sfiles+1
|
||||
" jms wakeup
|
||||
" dac sfiles+1
|
||||
jmp ttyrestart i " Now return from the routine
|
||||
|
||||
getchar: 0
|
||||
lac d65 " For now, return ASCII A
|
||||
isz getchar
|
||||
jmp i getchar
|
||||
|
||||
putcr: 0
|
||||
lac o15
|
||||
dac nttychar
|
||||
cla
|
||||
jmp putcr i
|
||||
|
||||
d2: 2
|
||||
d65: 64
|
||||
o12: 012
|
||||
o15: 015
|
||||
o20: 020
|
||||
|
||||
ttydelay: 0
|
||||
nttychar: .=.+1
|
||||
@@ -1,41 +0,0 @@
|
||||
" Alternative chrm: chrm file [file file ...]
|
||||
"
|
||||
" Unlink the named files
|
||||
|
||||
lac 017777 " Go to the argc
|
||||
tad d1 " Skip past the argc
|
||||
dac 2f " Save pointing at cmd name, we will skip later
|
||||
lac 017777 i " How many arguments do we have?
|
||||
sad d4
|
||||
sys exit " None, so exit
|
||||
tad dm4 " Subtract 1
|
||||
dac 017777 i " and save in the argc
|
||||
|
||||
1:
|
||||
lac 017777 i " Any arguments left?
|
||||
sna
|
||||
sys exit " No, exit the program
|
||||
tad dm4 " Subtract 4 from the argc and update it
|
||||
dac 017777 i
|
||||
lac 2f " Move up to the next filename
|
||||
tad d4
|
||||
dac 2f " and save it in the unlink arg
|
||||
sys unlink; 2:0 " Unlink the file
|
||||
sma
|
||||
jmp 1b " Loop back if the unlink was OK, or issue err
|
||||
lac 2b " Copy the filename pointer below
|
||||
dac 2f
|
||||
lac d1 " Write the filename on stdout
|
||||
sys write; 2:0; 4
|
||||
lac d1
|
||||
sys write; 1f; 2 " Write " ?\n" on stdout
|
||||
jmp 1b " and loop back
|
||||
|
||||
1:
|
||||
040077;012000 " String literal " ?\n"
|
||||
dd:
|
||||
<dd>;040040;040040;040040 " Filename dd
|
||||
d1: 1
|
||||
d4: 4
|
||||
d5: 5
|
||||
dm4: -4
|
||||
10
src/sys/s2.s
10
src/sys/s2.s
@@ -6,11 +6,6 @@
|
||||
" sys status; dir_name_ptr; file_name_ptr
|
||||
" NO_DD version: sys status; file_name_ptr
|
||||
.status:
|
||||
#ifdef NO_DD
|
||||
jms arg " fetch file name pointer
|
||||
dac .+3
|
||||
lac u.cdir " get current working directory
|
||||
#else
|
||||
jms arg " fetch directory name pointer
|
||||
dac .+5
|
||||
jms arg " fetch file name pointer
|
||||
@@ -18,7 +13,6 @@
|
||||
lac u.cdir " get current working directory
|
||||
jms namei; .. " look up source directory
|
||||
jms error " not found: return error to user
|
||||
#endif
|
||||
jms namei; .. " look up file
|
||||
jms error " not found: return error
|
||||
jms iget " read file inode
|
||||
@@ -110,11 +104,7 @@
|
||||
dac 1f
|
||||
jms arg
|
||||
dac 2f
|
||||
#ifdef NO_DD
|
||||
lac u.cdir " Search the current directory
|
||||
#else
|
||||
lac d4 " Search the directory at i-num 4
|
||||
#endif
|
||||
jms namei; 0:0 " for the first argument
|
||||
jms error " Didn't find it
|
||||
jms namei; 1:0 " In the i-num found by 1st namei,
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
pibreak: " priority interrupt break processing "chain"
|
||||
dac .ac " save interrupt AC
|
||||
"** CROSSED OUT....
|
||||
|
||||
#ifdef GRAPHICS2
|
||||
dpsf
|
||||
jmp 1f " disable the Graphics-2 I/O
|
||||
|
||||
@@ -26,7 +24,6 @@ pibreak: " priority interrupt break processing "chain"
|
||||
-1
|
||||
dac dpwrite
|
||||
jmp piret "** END OF CROSSOUT
|
||||
#endif
|
||||
|
||||
1: clsf " clock overflow (line frequency ticks)?
|
||||
jmp 1f " no
|
||||
@@ -90,7 +87,6 @@ cnop: " fetched as constant in iread
|
||||
dac .dspb
|
||||
jmp piret
|
||||
dsprestart:
|
||||
#ifdef GRAPHICS2
|
||||
lac d1
|
||||
dac .dspb " set .dsbp = 1
|
||||
lac dspbufp " load display buf pointer
|
||||
@@ -109,7 +105,6 @@ dsprestart:
|
||||
dac .lpba " save
|
||||
rlpd " G-2: resume after light pen stop
|
||||
jmp piret
|
||||
#endif
|
||||
|
||||
1: ksf " (TTY) keyboard flag set?
|
||||
jmp 1f " no
|
||||
|
||||
Reference in New Issue
Block a user