annotate level1/modules/kernel/faproc.asm @ 2615:530759e9f289

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