|
|
1.1 root 1: notes for IODisk presentation
2:
3: IODevAndIdInfo usage
4:
5: * Declared in disk driver's kernel glue layer
6: * Fields:
7: * rawDev, blockDev:
8: * init'd:
9: * in dev-specific routine in kernel glue layer (e.g.,
10: sd_init_idmap(), called from SCSIDisk's +initialize)
11: * Used:
12: * for volCheck communication (needed for insertion/automount)
13:
14: * id's
15: * init'd:
16: * in -registerUnixDisk (in mk/driverkit/kernselDiskMethods,
17: called from IODiskPartition +probe, for both physical disk and all
18: valid IODiskPartition instances).
19: * Used:
20: * in kernel glue layer, to convert dev_t to id
21:
22: * IODisk instances have pointer to associated IODevAndIdInfo.
23: * init'd by -setDevAndIdInfo
24: * in dev-specific +probe for physical disks
25: * in -connectToPhysicalDisk for all logical disks (it's set to phys
26: disk's IODevAndIdInfo)
27:
28: * used:
29: * connectToPhysicalDisk, to get physicalDisk's struct
30: * {register,unregister}UnixDisk
31: * Calls from IODisk to volCheckRegister()
32:
33: * Protocols to be implemented by disk drivers
34:
35: @protocol IODiskReadingAndWriting
36:
37: - (IOReturn) readAt : (unsigned)offset
38: length : (unsigned)length
39: buffer : (unsigned char *)buffer
40: actualLength : (unsigned *)actualLength
41: client : (vm_task_t)client;
42:
43: - (IOReturn) readAsyncAt : (unsigned)offset
44: length : (unsigned)length
45: buffer : (unsigned char *)buffer
46: pending : (void *)pending
47: client : (vm_task_t)client;
48:
49: - (IOReturn) writeAt : (unsigned)offset
50: length : (unsigned)length
51: buffer : (unsigned char *)buffer
52: actualLength : (unsigned *)actualLength
53: client : (vm_task_t)client;
54:
55: - (IOReturn) writeAsyncAt : (unsigned)offset
56: length : (unsigned)length
57: buffer : (unsigned char *)buffer
58: pending : (void *)pending
59: client : (vm_task_t)client;
60: @end
61:
62: @protocol IOPhysicalDiskMethods
63:
64: /* called when volCheck or IODiskPartition knows that something
65: has changed which driver should be aware of.
66: e.g.: setFormatted, disk insertion detect, transition to ready. */
67:
68: - (IOReturn)updatePhysicalParameters;
69:
70: /* called by volCheck per user input on insert request panel */
71:
72: - (void)abortRequest;
73:
74: /* called by volCheck when transition to ready is detected. Wakes up
75: I/O threads which are waiting for disk. */
76:
77: - (void)diskBecameReady;
78:
79: /* ensures disk is present/ready, with alert panel if necessary. Called
80: by clients before doing r/w. */
81:
82: - (IOReturn)isDiskReady : (BOOL)prompt;
83:
84: - (IOReturn) ejectPhysical;
85:
86: /* Used by volCheck (mostly) and at probe time by IODiskPartition. */
87: - (IODiskReadyState)updateReadyState;
88:
89: @end
90:
91: .........................................
92:
93: Outline:
94:
95: 1. Intro
96: -- class hierarchy - draw it
97: -- leaf classes just know how to read, write, eject, sense status
98: -- IODiskPartition takes care of disk labels, partitions
99: -- volCheck module takes care of polling for ready and panel requests
100:
101: 2. volCheck module functions:
102: -- insertion detection
103: -- alert panels
104: -- abort notification
105:
106: Discuss briefly the IPC between vol and WS.
107:
108: 3. IODiskReadingAndWriting protocol
109: -- briefly mention 'pending', more to come...
110:
111: 4. IOPhysicalDiskMethods protocol
112:
113: 5. kernel glue layer
114:
115: Start with IODevAndIdInfo.
116:
117: 6. I/O thread architecture, incl. I/O queues
118:
119: 7. Q&A
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.