adding a link to the thesis and cleaning it up a little
This commit is contained in:
@ -275,7 +275,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
char buf[100], *bufp = &buf[0], *endp = &buf[100];
|
||||
Put(c)
|
||||
{
|
||||
@ -283,7 +283,7 @@
|
||||
if(bufp == endp)
|
||||
flush();
|
||||
}
|
||||
|
||||
|
||||
Put: // (character is passed register d0)
|
||||
move.l (bufp),a0 // (1) Load buffer pointer into register a0
|
||||
move.b d0,(a0)+ // (2) Store the character and increment the a0 register
|
||||
@ -299,7 +299,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
Put: // (character is passed register d0)
|
||||
move.l (P),a0 // Load buffer pointer into register a0
|
||||
move.b d0,(a0,D) // Store the character
|
||||
@ -416,7 +416,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
proc:
|
||||
:
|
||||
:
|
||||
@ -426,7 +426,7 @@
|
||||
{Restore necessary context}
|
||||
:
|
||||
:
|
||||
|
||||
|
||||
swtch:
|
||||
move.l (Current),a0 // (1) Get address of current thread's TTE
|
||||
move.l sp,(a0) // (2) Save its stack pointer
|
||||
@ -552,7 +552,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
intr: move.l a0,-(sp) // Save register a0
|
||||
move.l (P),a0 // Get buffer pointer into reg. a0
|
||||
move.l (cd_port),(a0,D) // Store CD data into address P+D
|
||||
@ -566,7 +566,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
s.intr:
|
||||
move.l a0,-(sp) // Save register a0
|
||||
tst.b (cd_active) // Is the CD device active?
|
||||
@ -604,13 +604,13 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
s_intr:
|
||||
movem.l <d0-d2,a0-a2>,-(sp)
|
||||
bsr _sound_intr
|
||||
movem.l (sp)+,<d0-d2,a0-a2>
|
||||
rte
|
||||
|
||||
|
||||
sound_intr()
|
||||
{
|
||||
if(cd_active) {
|
||||
@ -703,13 +703,13 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
// --- User-level stub procedure ---
|
||||
proc:
|
||||
moveq #N,d2 // Load procedure index
|
||||
trap #15 // Trap to kernel
|
||||
rts // Return
|
||||
|
||||
|
||||
// --- Dispatch to kernel procedure ---
|
||||
trap15:
|
||||
cmp.w #MAX,d2 // Check that procedure index is in range
|
||||
@ -717,7 +717,7 @@
|
||||
move.l (tab$,pc,d2*4),a2 // Get the procedure address
|
||||
jsr (a2) // Call it
|
||||
rte // Return to user-level
|
||||
|
||||
|
||||
.align 4 // Table of kernel procedure addresses...
|
||||
tab$:
|
||||
dc.l fn0, fn1, fn2, fn3, ..., fnN
|
||||
|
@ -104,11 +104,10 @@
|
||||
%h3 4.1.1 Quaject Interfaces
|
||||
%p
|
||||
The interface to a quaject consists of callentries, callbacks, and callouts. A client uses the services of a quaject by calling a callentry. Normally a callentry invocation simply returns. Exceptional situations return along callbacks. Callouts are places in the quaject where external calls to other quaject's callentries happen. Tables 4.2, 4.3, and 4.4 list the interfaces to the Synthesis basic kernel quajects.
|
||||
/ - - FINISH - THIS SHOULD BE A FIGURE - -
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
+-----------+--------------------+-----------+
|
||||
| Qput | | Qget |
|
||||
+-----------+ ---+--+--+ +-----------+
|
||||
|
@ -70,9 +70,8 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
int data_val;
|
||||
|
||||
|
||||
AtomicUpdate(update_function)
|
||||
{
|
||||
retry:
|
||||
@ -86,7 +85,6 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
CAS(mem_addr, compare_value, update_value)
|
||||
{
|
||||
if(*mem_addr == compare_value) {
|
||||
@ -105,7 +103,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
CAS2(mem_addr1, mem_addr2, compare1, compare2, update1, update2)
|
||||
{
|
||||
if(*mem_addr1 == compare1 && *mem_addr2 == compare2) {
|
||||
@ -166,7 +164,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
Insert(elem)
|
||||
{
|
||||
retry:
|
||||
@ -175,7 +173,7 @@
|
||||
if(CAS(&list_head, old_head, elem) == FAIL)
|
||||
goto retry;
|
||||
}
|
||||
|
||||
|
||||
Delete()
|
||||
{
|
||||
retry:
|
||||
@ -201,7 +199,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
Push(elem)
|
||||
{
|
||||
retry:
|
||||
@ -211,7 +209,7 @@
|
||||
if(CAS2(&SP, new_SP, old_SP, old_val, new_SP, elem) == FAIL)
|
||||
goto retry;
|
||||
}
|
||||
|
||||
|
||||
Pop()
|
||||
{
|
||||
retry:
|
||||
@ -242,7 +240,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
Put(elem)
|
||||
{
|
||||
retry:
|
||||
@ -256,7 +254,7 @@
|
||||
if(CAS2(&Q_head, new_head, old_head, old_elem, new_head, elem) == FAIL)
|
||||
goto retry;
|
||||
}
|
||||
|
||||
|
||||
Get()
|
||||
{
|
||||
retry:
|
||||
@ -284,7 +282,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
VisitNextNode(current)
|
||||
{
|
||||
nextp = & current->next; // Point to current node's next-node field
|
||||
@ -299,7 +297,7 @@
|
||||
}
|
||||
return next_node;
|
||||
}
|
||||
|
||||
|
||||
ReleaseNode(current)
|
||||
{
|
||||
refp = & current->refcnt; // Point to current node's ref. count field
|
||||
@ -418,7 +416,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
retry: move.l (head),d1 // Get head node into reg. d1
|
||||
move.l d1,a0 // ... copy to register 'a0'
|
||||
beq empty // ... jump if list empty
|
||||
@ -434,7 +432,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
move.w %sr,d0 // Save CPU status reg. in reg. d0
|
||||
or.w #0x0700,%sr // Disable interrupts.
|
||||
spin: tas lock // Obtain lock
|
||||
|
@ -121,7 +121,6 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
int residue=0, freq=0;
|
||||
/* Master (reference frame) */ /* Slave (derived interrupt) */
|
||||
i1() i2()
|
||||
@ -139,7 +138,6 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
LoPass(x)
|
||||
{
|
||||
static int lopass;
|
||||
@ -184,7 +182,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
Integrate(x)
|
||||
{
|
||||
static int accum;
|
||||
@ -195,7 +193,7 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
|
||||
Deriv(x)
|
||||
{
|
||||
static int old_x;
|
||||
@ -244,12 +242,11 @@
|
||||
.code
|
||||
%pre
|
||||
:preserve
|
||||
|
||||
main()
|
||||
{
|
||||
char buf[100];
|
||||
int n, fd1, fd2;
|
||||
|
||||
|
||||
fd1 = open("/dev/cd", 0);
|
||||
fd2 = open("/dev/speaker", 1);
|
||||
for(;;) {
|
||||
|
@ -381,7 +381,7 @@
|
||||
%p
|
||||
Perhaps the first question people ask is, "Why is Synthesis written in assembler?" This is soon followed by "How much of Synthesis could be re-written in a high-level language?" and "At what performance loss?".
|
||||
%p
|
||||
There are several reasons why assembler language was chosen, some of them researchrelated, and some of them historical. One reason is I felt that it would be an interesting experiment to write a medium-size system in assembler, which allows unrestricted access to the machine's architecture, and perhaps discover new coding idioms that have not yet been captured in a higher-level language. Later paragraphs talk about these. Another reason is that much of the early work involved discovering the most efficient way of working with the machine and its devices. It was a fast prototyping language, one in which I could write and test simple I/O drivers without the trouble of supporting a complex language runtime environment.
|
||||
There are several reasons why assembler language was chosen, some of them research related, and some of them historical. One reason is I felt that it would be an interesting experiment to write a medium-size system in assembler, which allows unrestricted access to the machine's architecture, and perhaps discover new coding idioms that have not yet been captured in a higher-level language. Later paragraphs talk about these. Another reason is that much of the early work involved discovering the most efficient way of working with the machine and its devices. It was a fast prototyping language, one in which I could write and test simple I/O drivers without the trouble of supporting a complex language runtime environment.
|
||||
%p
|
||||
But perhaps the biggest reason is that in 1984, at the time the seed ideas were being developed, I could not find a good, reliable (bug-free) C compiler for the 68000 processor. I had tried the compilers on several 68000-based
|
||||
%span.smallcaps Unix
|
||||
@ -418,7 +418,7 @@
|
||||
%h3 7.4.2 Porting Synthesis to the Sony NEWS Workstation
|
||||
%p
|
||||
Synthesis was first developed for the Quamachine, and like many substantial software systems, has gone through several revisions. The early kernel had several shortcomings. While the kernel showed impressive speed gains over conventional operating systems such as
|
||||
= succeed "," do
|
||||
= succeed "." do
|
||||
%span.smallcaps Unix
|
||||
%p
|
||||
The goal of the Synthesis port to the Sony workstation was to alleviate the shortcomings, for example, by cleaning up the kernel structure and adding virtual memory and networking support. In particular, we wanted to show that the additional functionality would not significantly slow down the Synthesis kernel. This section reports on the experience and discusses the problems encountered while porting.
|
||||
|
Reference in New Issue
Block a user