2018
|
1 **************************************************
|
|
2 * System Call: F$AProc
|
|
3 *
|
|
4 * Function: Insert process into active process queue
|
|
5 *
|
|
6 * Input: X = Address of process descriptor
|
|
7 *
|
|
8 * Output: None (U and Y are preserved)
|
|
9 *
|
|
10 * Error: CC = C bit set; B = error code
|
|
11 *
|
|
12 * "An Ode to Dr. Lee"
|
|
13 * (1:27PM, Feb 23, 2006)
|
|
14 *
|
|
15 * Sitting in CMPS 455, I listen to Dr. Lee,
|
|
16 * His teaching style is as awful as any can be.
|
|
17 * Operating System Principles I have seen many times before,
|
|
18 * And as a result, this class is a major bore.
|
|
19 * As he talks about file systems, I work on NitrOS-9,
|
|
20 * even though I pay no attention, I do not fall behind.
|
|
21 *
|
|
22 * - Anonymous Student who returned
|
|
23 * to university to complete his
|
|
24 * computer science degree while working
|
|
25 * on The NitrOS-9 Project.
|
|
26 *
|
|
27 FAProc ldx R$X,u get ptr to process to activate
|
|
28 L021A pshs u,y save U/Y on stack
|
|
29 ldu #(D.AProcQ-P$Queue)
|
|
30 bra L0228
|
|
31 L0221 ldb P$Age,u get process age
|
|
32 incb update it
|
|
33 beq L0228 branch if wrap
|
|
34 stb P$Age,u save it back to proc desc
|
|
35 L0228 ldu P$Queue,u get pointer to queue this process queue
|
|
36 bne L0221 branch if process is in active queue
|
|
37 ldu #(D.AProcQ-P$Queue)
|
|
38 lda P$Prior,x get process priority
|
|
39 sta P$Age,x save it as age (How long its been around)
|
|
40 orcc #IntMasks mask interrupts
|
|
41 L0235 leay ,u point Y to current process
|
|
42 ldu P$Queue,u get pointer to queue
|
|
43 beq L023F
|
|
44 cmpa P$Age,u match process ages?
|
|
45 bls L0235 no, skip update
|
|
46 L023F stu P$Queue,x
|
|
47 stx P$Queue,y
|
|
48 clrb
|
|
49 puls pc,u,y restore U/Y and return
|
|
50
|