|
|
1.1 ! root 1: {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\fmodern Courier;\f2\fmodern Ohlfs;} ! 2: \paperw13700 ! 3: \paperh7320 ! 4: \margl120 ! 5: \margr120 ! 6: {\colortbl;\red0\green0\blue0;} ! 7: \pard\tx1340\tx2680\tx4020\tx5360\tx6720\tx8060\tx9400\tx10740\tx12080\tx13440\f0\b0\i0\ulnone\fs28\fc0\cf0 This directory has an example loadable kernel server and a user-level program that communicates with it. \ ! 8: \ ! 9: The loadable kernel server accepts two MiG-generated remote procedure calls: ! 10: \b mydriver_import() ! 11: \b0 , which sends data to the server, and ! 12: \b mydriver_export() ! 13: \b0 , which gets data from the server.\ ! 14: \ ! 15: Chapter 3, "Using Loadable Kernel Servers," of ! 16: \i NeXT Operating System Software ! 17: \i0 gives more information on implementing user-level programs that communicate with loadable kernel servers. ! 18: \i Writing Loadable Kernel Servers ! 19: \i0 gives information on implementing your own loadable kernel server.\ ! 20: \ ! 21: To build the loadable kernel server and user program, follow these steps:\ ! 22: \ ! 23: 1) Make a copy of this directory and change to the new directory in a Terminal window. For example:\ ! 24: ! 25: \f1\fc1\cf1 localhost> ! 26: \b cp -r /NextDeveloper/Examples/UNIX/LKSOutOfLineData ~ ! 27: \f0\b0\fc0\cf0 \ ! 28: ! 29: \f1\fc1\cf1 localhost> ! 30: \b cd ! 31: \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc1\cf1 ~/ ! 32: \pard\tx1340\tx2680\tx4020\tx5360\tx6720\tx8060\tx9400\tx10740\tx12080\tx13440\fc1\cf1 LKSOutOfLineData ! 33: \f0\b0 \ ! 34: \ ! 35: 2) Run ! 36: \b make ! 37: \b0 in the ! 38: \b KernelServer ! 39: \b0 directory. (It's important that you make the server before the user program, since the user program depends on files created during this step.)\ ! 40: ! 41: \f1 localhost> ! 42: \b cd KernelServer\ ! 43: ! 44: \b0 localhost> ! 45: \b make\ ! 46: ! 47: \f0\b0 \ ! 48: 3) Run ! 49: \b make ! 50: \b0 in the ! 51: \b User ! 52: \b0 directory. \ ! 53: ! 54: \f1 localhost> ! 55: \b cd ../User\ ! 56: ! 57: \b0 localhost> ! 58: \b make ! 59: \b0 \ ! 60: ! 61: \f0 \ ! 62: \ ! 63: To use the user program:\ ! 64: \ ! 65: 1) Allocate the loadable kernel server. It loads automatically once it's allocated.\ ! 66: ! 67: \f1 localhost> ! 68: \b su\ ! 69: ! 70: \f0\b0 ! 71: \f1 Password:\ ! 72: localhost# ! 73: \b kl_util -a ../KernelServer/mydriver_reloc ! 74: \b0 \ ! 75: Adding server with relocatable /me/LKSOutOfLineData/User/.. /KernelServer/mydriver_reloc\ ! 76: Allocating server mydriver\ ! 77: Server mydriver linking /me/LKSOutOfLineData/User/..\ ! 78: /KernelServer/mydriver_reloc against /mach\ ! 79: Server mydriver linking relocatable "/me/LKSOutOfLineData/User/..\ ! 80: /KernelServer/mydriver_reloc" into loadable "/me/\ ! 81: LKSOutOfLineData/User/../KernelServer/mydriver_loadable"\ ! 82: Server mydriver Allocated\ ! 83: localhost# \ ! 84: ! 85: \b \ ! 86: ! 87: \f0\b0 2) Run the user program. \ ! 88: ! 89: \f1 localhost# ! 90: \b ./test ! 91: \b0 \ ! 92: Data is: blah\ ! 93: Calling mydriver_import().\ ! 94: Calling mydriver_export().\ ! 95: Trying to access data.\ ! 96: First data element is: A\ ! 97: Second data element is: C\ ! 98: Third data element is: K\ ! 99: Fourth data element is: \ ! 100: Fifth data element is: \ ! 101: Contents of data are: ACK\ ! 102: ! 103: \f0 \ ! 104: 3) If you wish to modify the loadable kernel server and then reload it, you should delete the running version of the ! 105: \b kern_loader ! 106: \b0 before allocating the kernel server again.\ ! 107: ! 108: \f1 localhost# ! 109: \b kl_util -d mydriver\ ! 110: ! 111: \b0 Server mydriver deallocating\ ! 112: Server mydriver unloading\ ! 113: Server mydriver re-Allocated\ ! 114: Server mydriver Deallocated\ ! 115: ! 116: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.