Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

58KB

Developing Your Own 32-Bit Operating System — Back-Matter: Index, publisher ads, CD-ROM installation and contents, back cover

  • Source: /library/Developing Your Own 32-Bit Operating System/source-file.pdf
  • PDF pages: 741–772
  • Pages without text: 741, 764, 766, 769

Index

720 I 32-bit software Symbols 32-bit software, 130-131 386 microprocessors, 6 DASM assembler instruc- tion set, 682-688 486 microprocessors, 6 abstraction (hardware), 82 accessing devices (file system), 206 active job (monitor), 160 AddAliasRun function, 388-390 AddCallGate( ) call, 227-228 AddGDTCaUGate( ) call, 394-395 AddIDTGate( ) call, 228-229, 395-396 AddOSPT function, 392-394 addresses CM32, 699 DASM assembler, 673-675 files (logical), 204 memory, aliasing, 78 AddRun function, 387-388 AddUserPT function, 390-392 Alarm( ) call, 229 Alarm( ) function, 151, 406 timer, 411-412 aliases (memory addresses), 78 AliasMem( ) call, 229-230, 397-400 allocating memory, 63 linear, 76 linked list memory allocation, 65-66 listing 5.3 returning memory to free pool, 67-68 physical, 77 AllocDMAMem( ) function, 158 AllocDMAPage( ) call, 230 AllocDMAPage( ) function, 76 AUocExch( ) call, 230 AUocExch( ) function, 45, 135, 370-371 AllocOSPage( ) call, 230-231, 396-397 AllocOSPage( ) function, 76 AllocPage( ) call, 231 AllocPage( ) function, 76, 134 alphanumeric key values (keyboard), 193 ANSI (CM32), 702-703 API (Application Program- ming Interface), 8, 116-119 documenting, 1 16 procedural interfaces, 116-120 calling, 117-118 error handling, 119 hardware, 118-119 portability, 119 systems programming, 120-125 device drivers, 120-125 internal calls, 120 applications chaining, 140 CLI (Command-Line Interpreter), 266-288 external commands, 270-271 hot keys, 271 internal commands, 266-270 program listing, 271-288 debugger, 185 DumbTerm, 314-317 editor, 288-314 exiting, 140 Job Control Block, 136-137 messaging, 135 arguments (CM32), 699-700 assemblers, 16, 16-17 DASM, 331,664-668 386 instruction set, 682-688 addressing, 673-675 CALL instruction, 679-681 command line options, 667-668 DOT commands, 670-672 error codes, 693-696 EXTERN declarations, (~-678 JUMP instruction, 679-681

calls 721 local declarations, 668-669 memory, 669 prefixes, 678-679 PUBLIC declarations, 677 storage, 675-676 DOS, 672-673 Assign Keyboard ( ) function, 192 asynchronous system services, 146 Beep( ) call, 231 timer, 417-418 Beep_Work( ) function (timer), 416-417 Block mode (files), 203-204 block-oriented devices (DMA), 85-86 boot sector (File Allocation Table), 593 booting, 100-111 from different operating system, 111 ROM (Read Only Memory), 100 sectors, 101-110 buffers (keyboard), 557 buses, 83-84 C language (CM32), 699 character constants, 702 preprocessor commands, 702 statements, 701-702 storage classes, 701-702 CALL instruction (DASM assembler), 679-681 caller information (request blocks), 145-150 calling device drivers, 149, 154-156 internal, systems program- ming, 120 operating systems, 1 3 1 - 1 32 stacks, 132-134 source code, 328 calling conventions (proce- dural interfaces), 117-118 calls AddCallGate( ), 227-228 AddIDTGate( ), 228-229 Alarm( ), 229 AliasMem( ), 229-230 AllocDMAPage( ), 230 AllocExch( ), 230 AllocOSPageO, 230-231 AllocPage(),231 Beep(),231 Chain(), 231 CheckMsg( ), 232 ClrScr( ), 232 Compare( ), 233 CompareNCS( ), 233 CopyData( ), 233 CopyDataR( ), 233-234 DeAliasMem( ), 234 DeAllocExch( ), 234 DeAllocPage( ), 234 Devicelnit( ), 235 DeviceOp( ), 235-236 DeviceStat( ), 236 DMASetUp( ), 236-237 EditLine( ), 237 EndOflRQ (),237 ExitJob( ), 238 far calls (CM32), 700 FillData( ), 238 GetCmdLine( ), 238-239 GetCMOSDate( ), 239 GetCMOSTime( ), 239 GetDMACount( ), 240 GetExitJob( ), 240 GetIRQVector(), 240-241 GetJobNum(), 241 GetNormVid( ), 241 GetPath(), 241-242 GetPhyAdd( ), 242 GetpJCB( ), 242 GetSysIn( ), 242, 243 GetSysOut( ), 243 GetTimerTick( ), 243 GetTSSExch( ), 243 GetVidChar( ), 244, 581 GetVidOwner( ), 244 GetXY( ), 244 HardXY( ), 584 InByte( ), 244 InDWord( ), 245 InitDevDr( ), 245-246 InWord( ), 245 InWords( ), 245 ISendMsg ( ), 246-247 KillAlarm ( ), 247 LoadNewJob( ), 247 MasklRQ (),248 MicroDelay( ), 248 MoveRequest( ), 248-249 NewTask( ), 249

0 calls OutByte( ), 249 OutDWord( ), 249 OutWord( ), 250 OutWords( ), 250 public, 222 device drivers, 225 I/O, 226 interrupts, 226-227 jobs, 224-225 keyboard 227 memory, 225-226, 394-404 messaging, 224 moving data, 226 parameters, 222-223 speakers, 227 stacks, 224 system service, 225 tasks, 225 timers, 226 video, 227 PutVidAttrs( ), 250, 580 PutVidChars( ), 250-251, 580 QueryPagesO, 251 ReadCMOS(),251 ReadKbd 0,251-252 RegisterSvc( ), 252 Request( ), 252-253 Respond( ), 254 ScrollVid( ), 254 see also functions SendMsg ( ), 254-255 SetCmdLine( ), 255 SetExitJob( ), 255-256 SetIRQVector( ), 256-257 SetJobName( ), 257 SetNormVid( ), 257-258 SetPath( ), 258 SetPriority( ), 258 SetSysIn( ), 258-259 SetSysOut( ), 259 SetUserName( ), 259 SetVidOwner( ), 259-260, 574 SecXY( ), 260 Sleep( ), 260 SpawnTask( ), 261 Tone( ), 261-262 TTYOut (), 262 UnMasklQR ( ), 262-263 UnRegisterSvc( ), 263 WaitMsg( ), 263 see also functions Chain( ) call, 231 Chain( ) function, 140, 440,448 chaining applications, 140 character constants (C language), 702 CheckMsg( ) call, 232 CheckMsg( ) function, 46, 135, 363-366 ChkRdyQ function, 341-342 classes (C language), 701-702 CLI (Command-Line Interpreter), 266-288 external commands, 270-271 hot keys, 271 internal commands, 266-270 Cls (Clear Screen), 267 Copy, 267 Debug, 268 Del (Deleting files), 268 Dir (Directory Listing), 267-268 Exit, 268 Help, 268 MD (Make Directory), 269 Monitor, 268 Path (Set File-Access Path), 269 RD (Remove Directory), 269 Rename (files), 270 Run, 270 program listing, 271-288 client/server, 7 CloseFile( ) function, 207 closing files, 220 ClrScr( ) call, 232 ClrScr( ) function, 575 Cls (Clear Screen com- mand), 267 CM32 (C-Minus), 698 addresses, 699 ANSI, 702-703 argument lists, 699-700 C language, 699 character constants, 702 preprocessor commands, 702 statements, 701-702 storage classes, 701-702 command line options, 707-708 compiler, 331 compiling, 707-718 far calls, 700

DCB (Device Control Block), device drivers 0 far external functions, 703-704 interrupts, 700 library functions, 708-709 library header file access, 702 memory, 699 pointers, 704 program listings I/O file for MMURTL, 709-714 library functions, 708-709 standard string functions, 715-718 shift right function, 706 static variables initializing, 704-706 string functions, 715 structures, 706 type conversion, 704 code borrowing, 333 comments, 328 modular, 332 command lines CM32, 707-708 DASM assembler, 667-668 device drivers, 668 DLLs (Dynamic Link Libraries), 668 error statements, 668 list files, 667-668 Command-Line Interpreter, seeCU commands C language (preprocessor), 702 CLI (Command-Line Interpreter) external, 270-271 internal, 266-270 DOT (DASM assembler), 670-672 editor, 288-290 VIRTUAL, 422-429 COMMANDS.CLI file, 270-271 comments, 328 Compare( ) call, 233 CompareNCS( ) call, 233 compiling CM32, 707-718 compiler, 331 DASM assembler, 331 MMURTL, 331-332 cooperative multitasking, 31-32 queueing (scheduling tasks), 34 scheduling tasks, 34 Copy command, 267 CopyData( ) call, 233 CopyDataR( ) call, 233-234 CPU (Central Processing Unit), 82-83 bus structure, 83-84 tasks (time), 30-32 CreateDirectory( ) function, 215 CreateFile( ) function, 213 cursor key codes, 1 98 positioning, 584-586 D DASM assembler, 331, 664-668 386 instruction set, 682-688 addressing, 673-675 CALL instruction, 679-681 command line options, 667-668 device drivers, 668 DLLs (Dynamic Link Libraries), 668 error statements, 668 list files, 667-668 DOS assemblers, 672-673 DOT commands, 670-672 error codes, 693-696 EXTERN declarations, 677-678 JUMP instruction, 679-681 local declarations, 668-669 memory, 669 prefixes, 678-679 program listings alternating data and code, 669-670 application template file (listing 28.1), 666 application template file (listing 28.2), 666-667 PUBLIC declarations, 677 storage, 675-676 DCB (Device Control Block), device drivers, 152-154

0 DD (Define Double Word) DD (Define Double Word), 676 DeAliasMem( ) call, 234, 400-401 deallocating linear memory, 76-77 DeAllocExch( ) call, 234 DeAllocExch( ) function, 135, 371-373 DeAllocMem( ) call, 401-403 DeAllocPage( ) call, 234 DeAllocPage! ) function, 134 Debug command, 268 debugger, 182-185 debugging applications, 185 display, 183 entering, 182 exiting, 182 function keys, 183-184 interrupt procedure, 472-473 keyboard, 565 processors, 185-188 program listings debugger data and code, 474-496 exception handlers for entering debugger, 472-473 source code, 473-496 Debugger.ASM (MMURTL source file), 329 Del command (Deleting files), 268 DeleteDirectory( ) function, 216 DeleteFile( ) function, 214 demand-paged flat memory, 59 demand-paged memory, 61 demand-paged virtual memory, 61 deQueueMsg function, 338-339 deQueueRdy function, 340-341 deQueueTSS function, 339 DevDrvr JVSM (MMURTL source file), 330 device drivers calling, 154-155 DASM assembler, 668 DCB (Device Control Block), 152-154 Devicelnit( ) function, 157 DeviceStat( ) function, 156 DMA, 151 errors, 158 IDE (Integrated Drive Electronics), 498-519 IDE device driver (listing 24.1), 498-499 IDE device driver (listing 24.2), 499-502 IDE device driver (listing 24.3), 502-504 IDE device driver code (listing 24.4), 504-508 IDE device driver code (listing 24.5), 508-515 IDE device driver code (listing 24.6), 515-519 initializing, 157-158 installing, 149-150 interrupts, 150 messaging features, 151 operating systems (func- tions), 158 public calls, 225 RS-232 asynchronous, 519-540’ device driver (listing 24.10), 525 device driver (listing 24.11), 526 device driver (listing 24.12), 526-528 device driver (listing 24.13), 528-535 device driver (listing 24.14), 535-540 device driver (listing 24.8), 521-523 device driver (listing 24.9), 523-525 header file (listing 24. 7), 519-520 system resources, 150-151 systems programming, 120-125 calling drivers, 124-125 calling operating system, 122-124 timers, 151 writing, 147-158 calling, 149 theory, 148 Devicelnit( ) call, 235 Devicelnit( ) function, 149, 154, 157 DeviceOp( ) call, 235-236

FA T (File Allocation Table) 0 DeviceOp( ) function, 149, 154-155 devices, accessing with file system, 206 DeviceStat( ) call, 236 DeviceStat( ) function, 149, 154, 156 DF (Define Far Word), 676 Dir command (Directory Listing), 267-268 directories MD command (Make Directory), 269 memory, paging 9PDs), 72-76 RD command (Remove Directory), 269 disks FAT (File Allocation Table), 592-593 boot sector, 593 hidden, 592 initializing, 593 LBA (Logical Block Address), 592-593 physical sector numbers, 592 see also file system display (debugger), 183 DLLs (Dynamic Link Libraries), 668 DMA (Direct Memory Access), 89-97 block-oriented devices, 85-86 device drivers, 151 DMACode-ASM (MMURTL source file), 330 DMASetUp( ) call, 236-237 DMASetUp( ) function, 151,158 documenting API, 116 DOS assemblers, 672-673 DOT commands (DASM assembler), 670-672 drivers device, writing, 147-158 systems programming calling drivers, 124-125 calling operating system, 122-124 device, 120-125 see also device drivers DumbTerm application, 324 DW (Define Word), 676 dynamic structures, 114 dynamic tables, 114 E edit keys (key codes), 198 EditLine( ) call, 237 EditLine( ) function, 586 editor, 288-314 commands, 288-290 program listing, 290-314 screen, 288 EndOflROJ ) call, 237 EndOflROJ ) function, 150-151, 158 enQueueMsg function, 337-338 enQueueRdy function, 340 entering debugger, 182 entry point (operating system), 422-429 errors DASM assemblers codes, 693-696 command line options, 668 device drivers, 158 procedural interfaces (API), 119 system services, 146-147 ExceptJVSM (MMURTL source file), 331 executable files, 688-693 tagged fields, 689 Exit command, 268 exit( ) function, 140 exiting applications, 140 debugger, 182 ExitJob( ) call, 238 ExitJob( ) function, 140, 440,448 EXTERN declarations (DASM assembler), 677-678 external commands (CLI), 270-271 F far calls (CM32), 700 far external functions (CM32), 703-704 FAT (File Allocation Table), 592-593 boot sector, 593 hidden, 592

0 FA T (File Allocation Table) initializing, 593 LBA (Logical Block Address), 592-593 physical sector numbers, 592 see also file system FCB (File Control Blocks), 217-218 File Allocation Tables, see FAT File Control Blocks (FCB), 217-218 file system, 593-660 MS-DOS FAT- compatible file system, 594-660 FUe User Blocks (FUB), 218 files addresses (logical), 204 closing, 220 COMMANDS.CLI, 270-271 Del command (Delete), 268 devices, accessing, 206 executable, 688-693 tagged fields, 689 FAT (File Allocation Table), 592-593 boot sector, 593 hidden, 592 initializing, 593 LBA (Logical Block Address), 592-593 physical sector numbers, 592 see also file system functions, 207-217 CloseFileO, 207-208 CreateDirectory( ), 215 CreateFile( ), 213-214 DeleteDirectory( ), 216 DeleteFile(), 214-215 GetDirSector( ), 216- 217 GetFiULFAO, 211 GetFileSize( ), 212 OpenFile(), 207 ReadBlock(), 208 ReadBytesO, 209-210 RenameFile(), 214 SetFiULFAO, 211-212 SetFileSize( ), 213 WriteBlocH ), 209 WriteBytes( ), 210-211 handles, 203 MMURTL source code, 328-331 modes Block, 203-204 open, 203 Stream, 204 names, 202 network specifications, 202-203 operations, 219-220 procedural interfaces, 206 reading, 220 system, 217-220 internal structure, 217-219 requests, 204-205 writing, 220 FillData( ) call, 238 FindHiPage function, 381 FindLoPage function, 382-383 FindRun function, 385-387 Floppy.C (MMURTL source file), 330 FUB (FUe User Blocks), 218 function keys debugger, 183-184 key codes, 196-197 monitor, 161 functions AddAliasRun, 388-390 AddOSPT, 392-394 AddRun, 387-388 AddUserPT, 390-392 Alarm(), 151,406 timer, 411-412 AllocDMAMem( ), 158 AllocDMAPage( ), 76 AllocExch( ), 45, 135 AllocOSPage( ), 76 AllocPage( ), 76, 134 Assign Keyboard( ), 192 Beep(), 417-418 Beep_Work(), 416-417 Chain(), 140,440,448 CheckMsg( ), 46, 135 CloseFile( ), 207 ClrScr( ), 575 CM32 library, 708-709 string, 715 CreateDirectory( ), 215 CreateFile(), 213 DeAllocExch( ), 135 DeAllocPage( ), 134 DeleteDirectory( ), 216 DeleteFileO, 214 device drivers (operating systems), 158 Devicelnit( ), 149, 154, 157

junctions s DeviceOpO, 149, 154-155 DeviceS tat( ), 149, 154, 156 DMASetUpO, 151, 158 EditLine( ), 586 EndOflRQO, 150-151, 158 exit( ), 140 ExitJob( ), 140, 440, 448 far external (CM32), 703-704 files, 207-217 CbseFileO, 207-208 CreateDirectory( ), 215 CreateFile(), 213-214 DeleteDirectoryO, 216 DeleteFilef), 214-215 GetDirSector( ), 216-217 GetFiULFAO, 211 GetFiUSize( ), 212 OpenFile(), 207 ReadBlockO, 208 ReadBytes(), 209-210 RenameFileO, 214 SetFileLFAO, 211-212 SetFileSize( ), 213 WriteBlocH ), 209 WriteBytes( ), 210-211 FindHiPage, 381 FindLoPage, 382-383 FindRun, 385-387 GetCmdLine( ), 137,448 GetCMOSDate( ), 415-416 GetCMOSTime( ), 414-415 GetDirSector( ), 216 GetDMACount( ), 89 GetExitJob( ), 137,448 GetFileLFA(),211 GetFileSizeO, 212 GetJobNumO, 136 GetMeSomeMem( ), 52 GetPath(), 137,448 GetpJCBO, 136 GetTimerTick(),4l6 GetUserName( ), 137,448 GetVidChar (),138 GetXY( ), 586 hdisk_setup( ), 504 InitDevDrO, 148, 157 InitFS( ), 594 InitMemMgmt( ), 379 InitOSPublics( ), 429 internal public helper, 342-347 GetExchOwner, 344-345 RemoveRdyJob, 342-344 SendAbort, 346-347 SetExchOwner( ), 345-346 ISendMsgO, 151 job management, 448-469 KillAlarmO, 151 timer, 412-413 LinToPhy, 385 LoadNewJob( ), 448 local kernel helper, 337-342 ChkRdyQ, 341-342 deQueueMsg, 338-339 deQueueRdy, 340-341 deQueueTSS, 339 enQueueMsg, 337-338 enQueueRdy, 340 MarkPage, 383-384 MasklRQO, 150, 158 MicroDelayO, 413-414 MoveRequest( ), 146 NewTask( ), 46 Notify on Global Keys( ), 191-192 OpenFile( ), 207 public kernel, 348-375 AlbcExchO, 370-371 CheckMsgO, 363-366 DeAllocExch( ), 371-373 GetPriorityi ), 374-375 GetTTSExchO, 373 ISendMsgO, 357-359 MoveRequest( ), 354-355 NewTaskO, 366-368 Request( ), 348-351 RespondO, 351-353 SendMsgO, 355-357 SetPriority( ), 374 SpawnTaskO, 368-370 WaitMsgO, 359-363 PutVidChars ( ), 138 QueryPages( ), 134 Read Keyboard(), 191 ReadBlock( ), 208 ReadBytes( ), 209 ReadKbdO, 138 RenameFileO, 214 Request( ), 49, 135, 144 Respond( ), 49, 144 ScrollVid( ), 575, 582 see also calls SendMsgO, 135 SendMsg( ), 46 SetCmdLine( ), 448 SetExitJob( ), 137,448 SetFileLFAO, 211 SetFileSizeO, 213

728 I functions SetIRQVector( ), 150, 158 SetJobName( ), 137 SecNormVid( ), 575 SetPathO, 137 Setpath( ), 448 SetSysIn( ), 137 SetUpDMA( ), 89 SetUserName( ), 137,448 SetXY( ), 585 SleepO, 151,406 timer, 410-411 SpawnTask( ), 46, 136 Tone(),4l8 TTYOut( ), 577 UnMarkPage, 384 UnMasklRQO, 150, 158 wait( ), 44 WaitMsg( ), 46, 135 WriteBlock( ), 209 WriteBytesO, 210 GetCmdLine( ) call, 238-239 GetCmdLine( ) function, 137, 448 GetCMOSDate( ) caU, 239, 415-416 GetCMOSTime( ) call, 239, 414-415 GetDirSector( ) function, 216 GetDMACount( ) call, 240 GetDMACount( ) function, 89 GetExchOwner function, 344-345 GetExitJob( ) call, 240 GetExitJob( ) function, 137, 448 GetFUeLFA( ) function, 211 GetFileSize( ) function, 212 GetIRQVector( ) call, 240-241 GetJobNum( ) call, 241 GetJobNum( ) function, 136 GetMeSomeMem( ) function, 52 GetNormVid( ) call, 241 GetPath( ) call, 241-242 GetPath( ) function, 137, 448 GetPhyAdd( ) call, 242, 404 GetpJCB( ) call, 242 GetpJCB( ) function, 136 GetPriority( ) function, 374-375 GetSysIn( ) call, 242, 243 GetSysOut( ) call, 243 GetTimerTick( ) call, 243 GetTimerTick( ) function, 416 GetTSSExch( ) call, 243 GetTTSExch( ) function, 373 GetUserName( ) function, 137, 448 GetVidChar ( ) function, 138 GetVidChar( ) call, 244, 581 GetVidOwner( ) call, 244 GetXY( ) call, 244 GetXY( ) function, 586 graphics (video), 87-89 H_

handles (files), 203 HardIDE.C (MMURTL source file), 330 hardware, 17-20 abstraction, 82 block-oriented devices, 85-86 buses, 83-84 DMA (Direct Memory Access), 89-97 initializing, 111 isolating, 82 keyboard, 86-87, 566 PICU (Priority Interrupt Controller Unit), 98 procedural interfaces (API), 118-119 tasks, 29-30 timers, 97-98 video, 87-89 hardware requirements (MMURTL), 10-11 HardXY( ) call, 584 hdisk setup( ) function, 504 Help command, 268 hidden sectors (FAT), 592 hot keys (CLI), 271 I

I/O (public calls), 226 IDE disk device drivers, 498-519

interrupts H program listings IDE device driver (listing 24.1), 498-499 IDE device driver (listing 24.2), 499-502 IDE device driver (listing 24.3), 502-504 IDE device driver code (listing 24.4), 504-508 IDE device driver code (listing 24.5), 508-515 IDE device driver code (listing 24.6), 515-519 InByte( ) call, 244 InDWord( ) call, 245 InitCodcASM (MMURTL source file), 331 InitDevDr( ) call, 245-246 InitDevDr( ) function, 148, 157 InitFS( ) function, 594 initial job (monitor), 160-161 initializing device drivers, 157-158 FAT (File Allocation Table), 593 hardware, 111 memory, 69-70, 113-114, 379-381 operating system end of initialization, 429 initialization subrou- tines, 429-432 initialize call gates and IDT, 433-438 main operating system data, 420-422 operating system initialization and entry point, 423-427 operating system initialization, 427 operating system initialization, 427-429 static variables (CM32), 704-706 system services, 142 tasks, 112 video (listing 26.2), 574 InitKBDService (keyboard), 567-568 InitMemMgmt( ) function, 379 InitOSPublics( ) function, 429 input/output parallel I/O, 85 serial I/O, 84-85 installing device drivers, 149-150 IntCodcASM (MMURTL source file), 330 interfaces (procedural), 116-120 calling, 117-118 error handling, 119 files, 206 hardware, 118-119 portability, 119 internal calls, systems programming, 120 internal commands (CLI), 266-270 Cls (Clear Screen), 267 Copy, 267 Debug, 268 Del (Deleting files), 268 Dir (Directory Listing), 267-268 Exit, 268 Help, 268 MD (Make Directory), 269 Monitor, 268 Path (Set File-Access Path), 269 RD (Remove Directory), 269 Rename (files), 270 Run, 270 internal public helper functions, 342 GetExchOwner, 344-345 RemoveRdyJob, 342-344 SendAbort, 346-347 SetExchOwner( ), 345-346 internal structure (file system), 217-219 FAT (File Allocation Tables), 218-219 File Control Blocks (FCB), 217-218 File User Blocks (FUB), 218 interrupts, 39-40 CM32, 700 debugger, 472-473 device drivers, 1 50 messaging features, 151 latency, 53 PICU (Priority Interrupt Controller Unit), 98

730 | interrupts public calls, 226-227 timer, 408-418 InWord( ) call, 245 InWords( ) call, 245 IPC (Interprocess Commu- nications), 42-51 interrupt latency, 53 memory, 53-54 messages, 44-54 link blocks, 51 Request(), 48-50 Respond(), 50-51 multitasking (reetrancy), 51-53 pipes, 44 semaphores, 43-44 synchronization, 42 ISendMsg ( ) call, 246-247 ISendMsg( ) function, 151, 357-359 isolating hardware, 82 ISRs (Interrupt Service Routines), 39-40, 550-551 JCB (Job Control Block), 74, 136-137 job management program code, 448-469 subroutines, 440-447 JobC.C (MMURTL source file), 330 JobCode.ASM (MMURTL source file), 330 jobs monitor active, 160 initial, 160-161 public calls, 224-225 JUMP instruction (DASM assembler), 679-681 kernel functions internal public helper, 342-347 local helper, 337-342 public, 348-375 program listings adding task to ready queue, 340 allocate exchange code, 371 changing owner of exchanges, 345-346 CheckMsg kernel primitive code, 363-366 data segment source, 336-337 de-queueing a message, 338-339 de-queueing a task, 339 de-queueing highest priority task, 341 deallocate exchange code, 372-373 find highest physical page code, 382 finding highest priority task, 341-342 finding owner of exchanges, 344-345 Get priority code, 374-375 Get TSS exchange code, 373 ISendMsgO kernel primitive code, 358-359 MoveRequest kernel primitive code, 354-355 NewTask kernel primitive code, 366-368 notifying services of a job i demise, 346-347 queueingfor message exchange, 338 removing a terminated task from ready queue, 342-344 Request kernel primitive code, 348-351 Respond kernel primitive code, 351-353 SendMsg kernel primitive code, 356-357 Set priority code, 374 Spawn Task kernel primitive code, 369-370 WaitMsg kernel primitive code, 359-363 source file, 336-337 tasks, 47 KernelJVSM (MMURTL source file), 331

listings 731 kernels, 27 key codes (keyboard), 194-198 cursor, 198 edit keys, 198 function keys, 196-197 numeric key pad, 197-198 keyboard, 86-87, 138, 542-570 alphanumeric key values, 193 buffers, 557 debugger, 565 hardware setup, 566 hot keys (CLI), 271 InitKBDService, 567-568 ISR code, 550-551 KBDServiceTask, 557-563 key codes, 194-198 cursor, 198 edit keys, 198 function keys, 196-197 numeric key pad, 197-198 lock-state, 194 numeric keypad, 1 94 key codes, 197-198 procedural interface, 563-565 program listings code for blocking read keyboard call, 563-565 debugger read keyboard code, 565 initializing keyboard hardware, 566 keyboard buffer code, 557 keyboard data and tables, 542-550 keyboard ISR code, 550-551 keyboard service initialization, 567-568 keyboard system service code, 558-563 keyboard translation code, 552-556 low-level keyboard code, 568-570 public calls, 227 routines, 568-570 shift-states, 193-194 system services, 190-192 Assign Key boar d() function, 192 Notify on Global Keys( ) function, 191-192 Read Keyboard function, 191 translation, 551-556 KeyboardJVSM (MMURTL source file), 329 KillAlarm ( ) call, 247 KillAlarm( ) (unction, 151 timer, 412-413 L latency (interrupts), 53 LBA (Logical Block Address), 592-593 LFA (Logical File Ad- dresses), 204 library functions (CM32), 708-709 library header file access (CM32), 702 linear memory, 56 allocating, 76 deallocating, 76-77 tracking, 63-68 link blocks (messages), 51 linked lists program listings linked list memory allocation, 65-66 linked list memory management, 64 memory, 63-68 linkers (DASM), 664-665 LinToPhy function, 385 list files (DASM assembler), 667-668 listings 5.1 linked list memory management, 64 5.2 linked list memory allocation, 65-66 5.3 returning memory to free pool, 67-68 10.1 system service, 143-144 11.1 initial.Job.file, 160-161 11.2 monitor program, 163-179 14.1 File System request, 204-205 16.1 CLI (Command Line Interpreter), 271-288 16.2 Editor source code, 290-314 16.3 DumbTerm, 324 16.4 Print program, 324 16.5 System Service, 322-323

E listings 16.6 TestSvc.C, 324 18.1 kernel data segment source, 336-337 18.2 queueing for message exchange, 338 18.3 de-queueing a message, 338-339 18.4 de-queueing a task, 339 18.5 adding task to ready queue, 340 18.6 de-queueing highest priority task, 341 18.7 finding highest priority task, 341-342 18.8 removing a termi- nated task from ready queue, 342-344 18.9 finding owner of exchanges, 344-345 18.10 changing owner of exchanges, 345-346 18.1 1 notifying services of a job's demise, 346-347 18.12 Request kernel primitive code, 348-351 18.13 Respond kernel primitive code, 351-353 18.14 MoveRequest kernel primitive code, 354-355 18.15 SendMsg kernel primitive code, 356-357 18.16 ISendMsgO kernel primitive code, 358-359 18.17 WaitMsg kernel primitive code, 359-363 18.18 CheckMsg kernel primitive code, 363-366 18.19 NewTask kernel primitive code, 366-368 18.20 SpawnTask kernel primitive code, 369-370 18.21 allocate exchange code, 371 18.22 deallocate exchange code, 372-373 18.23 Get TSS exchange code, 373 18.24 Set priority code, 374 18.25 get priority code, 374-375 19.1 memory manage- ment, 378 19.2 memory management initialization code, 379 19.3 memory management initialization code, 379-380 19.4 memory management initialization code, 380 19.5 paged memory management initializa- tion code, 381 19.6 allocation of memory management exchange, 381 19.7 memory manage- ment initialization, 381 19.8 find highest physical page code, 382 19.9 find lowest physical page code, 383 19.10 code to mark a physical page in use, 384 19.1 1 code to free physical page for reuse, 384 19.12 converting physical addresses to linear, 385 19.13 finding free linear memory, 386-387 19.14 adding linear memory, 387-388 19.15 adding aliased linear memory, 389-390 19.16 adding page table for user memory, 390-392 19.17 operating system page tables, 392-394 19.18 adding call gates to the GDT, 394-395 19.19 adding entries to IDT, 395-396 19.20 allocating a page of linear memory, 396-397 19.21 code to alias memory, 398-400 19.22 code to remove alias PTEs, 400-401 19.23 deallocating linear memory, 401-403 19.24 code to find number of free pages, 403-404 19.25 public function converting linear to physic, 404 20.1 loop in timer ISR, 406-407 20.2 data and constants for timer, 407-408 20.3 external functions for timer code, 408 20.4 timer interrupts, 409-410 20.5 code for sleep function, 41 1 20.6 code for Alarm( ) function, 412 20.7 code for KillAlarm( ) function, 413 20.8 code for the MicroDelay( ) function. 414 20.9 code reading CMOS time, 414-415

listings E 20.10 code reading CMOS date, 415-416 20.1 1 code returning timer ticks, 416 20.12 helper function for Beep( ) and Tone( ), 417 20.13 code producing beeps, 418 20.14 code producing tones, 4 1 8 21.1 main operating system data, 420-422 2 1 .2 operating system initialization and entry point, 423-427 21.3 operating system initialization, 427 21.4 operating system initialization, 427-429 21.5 end of initialization, 429 21.6 initialization subroutines, 429-432 21.7 initialize call gates and IDT, 433-438 22. 1 job management subroutines, 440-447 22.2 job management code, 448-469 23.1 exception handlers for entering debugger, 472-473 23.2 debugger data and code, 474-496 24.1 IDE device driver, 498-499 24.2 IDE device driver, 499-502 24.3 IDE device driver, 502-504 24.4 IDE device driver code, 504-508 24.5 IDE device driver code, 508-515 24.6 IDE device driver code, 515-519 24.7 RS-232. header file, 519-520 24.8 RS-232 device driver, 521-523 24.9 RS-232 device driver, 523-525 24.10 RS-232 device driver, 525 24.11 RS-232 device driver, 526 24.12 RS-232 device driver, 526-528 24.13 RS-232 device driver code, 528-535 24.14 RS-232 device driver code, 535-540 25.1 keyboard data and tables, 542-550 25.2 keyboard ISR code, 550-551 25.3 keyboard translation code, 552-556 25.4 keyboard buffer code, 557 25.5 keyboard system service code, 558-563 25.6 code for blocking read keyboard call, 563-565 25.7 debugger read keyboard code, 565 25.8 initializing keyboard hardware, 566 25.9 keyboard service initialization, 567-568 25.10 low-level keyboard code, 568-570 26. 1 video constants and data, 573 26.2 initializing video, 574 26.3 code to set video owner, 574-575 26.4 code to set normal video attribute, 576 26.5 code to set normal video attribute, 576 26.6 code to get current video owner, 576-577 26.7 code to clear screen, 577 26.8 code for TTY output to screen, 578-579 26.9 code to screen video attributes, 580 26.10 code to place characters, 581 26. 1 1 code to get charac- ters and attributes, 582 26.12 code to scroll area of screen, 582-584 26.13 code to set cursor position, 585 26.14 code to set cursor position, 585-586 26. 1 5 code to return to current cursor position, 586 26.16 code to edit lines on screen, 587-589 27.1 MS-DOS FAT- compatible file system, 594-660 28.1 application template file, 666 28.2 application template file, 666-667 28.3 alternating data and code in template file, 669-670 29.1 library functions (CM32), 708-709

734 listings 29.2 library code-I/O file for MMURTL (CM32), 709-714 29.3 standard string functions (CM32), 715-718 loading memory, 77-78 LoadNewJob( ) call, 247 LoadNewJob( ) function, 448 local declarations (DASM assembler), 668-669 local kernel helper functions, 337 ChkRdyQ, 341-342 deQueueMsg, 338-339 deQueueRdy, 340-341 deQueueTSS, 339 enQueueMsg, 337-338 enQueueRdy, 340 lock-state (keyboard), 194 Logical File Addresses (LFA), 204 logical memory, 56 M MAIN.ASM (MMURTL source file), 329 mapping memory, 73-75 MarkPage function, 383-384 MasklRQ ( ) call, 248 MaskIRQ( ) function, 150, 158 MD command (Make Directory), 269 MemCodcASM (MMURTL source file), 330 memory 32-bit software, 131 address aliasing, 78 allocating, 63 CM32, 699 DASM assembler, 669 demand-paged, 61 demand-paged flat, 59 demand-paged virtual, 61 DMA (Direct Memory Access), 89-97 functions AddAliasRun, 388-390 AddOSPT, 392-394 AddRun, 387-388 AddUserPT, 390-392 FindHiPage, 381-382 FindLoPage, 382-383 FindRun, 385-387 InitMemMgmt, 379-381 LinToPhy, 385 MarkPage, 383-384 UnMarkPage, 384 initializing, 69-70, 113-114,379-381 IPC, 53-54 linear, 56 allocating, 76 deallocating, 76-77 tracking, 63-68 linked lists, 63-68 linked list memory allocation, 65-66 linked list memory management, 64 loading, 77-78 logical, 56 MMURTL, 132-135 paged flat, 58 paging, 72-80 allocating linear memory, 76 ■ allocating physical memory, 77 deallocating linear memory, 76-77 directories (PDs), 72-76 mapping, 73-75 tables, 72 physical, 56 allocating, 77 tracking, 63-69 pointers, 78-79 program listings adding aliased linear memory, 389-390 adding call gates with GDT, 394-395 adding entries to ID T, 395-396 adding linear memory, 387-388 adding page table for user memory, 390-392 allocating a page of linear memory, 396-397 allocation of memory management exchange, 381 code for KillAlarm() function, 413 code reading CMOS date, 415-416 code to alias memory, 398-400 code to find number of free pages, 403-404 code to free physical page for reuse, 384

multiple users (tasks) 0 code to mark a physical page in use, 384 code to remove alias PTEs, 400-401 converting physical addresses to linear, 385 deallocating linear memory, 401-403 external functions for timer code, 408 find lowest physical page code, 383 finding free linear memory, 386-387 memory management, 378 memory management initialization, 381 memory management initialization code, 379-380 operating system page tables, 392-394 paged memory management, 381 public function converting linear to physic, 404 returning memory to free pool, 67-68 protection, 70 public calls, 225-226, 394 AddGDTCallGateO, 394-395 AddIDTGate(), 395-396 AliasMemO, 397-400 AllocOSPage( ), 396-397 DeAliasMem( ), 400-401 DeAlbcMem(), 401-403 GetPhyAddO, 404 Query MemPages( ), 403-404 ROM (Read Only Memory), 100-110 segmented, 61-62, 71 simple flat, 57-58 structures, 112 tables, 68, 112 virtual, 8 virtual paged, 59-60 applications, 135 IPC Request(), 48-50 RespondO, 50-51 IPC (Interprocess Communications), 44-54 link blocks, 5 1 public calls, 224 system services, 142 asynchronous, 146 errors, 146-147 initializing, 142 listing 10.1, 143-144 request blocks, 144-145 MicroDelay( ) call, 248 MicroDelay( ) function, 413-414 microprocessors, 6 debugger, 185-188 MiscCodcASM (MMURTL source file), 330 MMURTL, 9-11 compiling, 331-332 hardware requirements, 10-11 memory, 132-135 operating systems (protec- tion), 134-135 source code borrowing, 333 files, 328-331 modular, 332 models (scheduling tasks), 38-40 modes (files) Block, 203-204 open, 203 Stream, 204 monitor active job, 160 function keys, 161 initial job, 160-161 performance statistics, 162-163 program listing, 163-179 program theory, 161-162 Monitor command, 268 Monitor.C(MMURTL source file), 331 MOSDPRJVSM (MMURTL source file), 329 MOSGDTJVSM (MMURTL source file), 329 MOSIDTASM (MMURTL source file), 329 MoveRequest( ) call, 248-249 MoveRequest( ) function, 146, 354-355 MpublicsASM (MMURTL source file), 329 multiple users (tasks), 28-29

multitasking multitasking, 7, 31-36 cooperative, 31-32 preemptive, 27, 32 reentxancy, 51-53 starting tasks, 136 N naming files, 202 network file specifications, 202-203 NewTask( ) call, 249 NewTask( ) function, 46, 366-368 Notify on Global Keys( ) function, 191-192 NumCnvrt.ASM (MMURTL source file), 330 numeric keypad key codes, 197-198 keyboard, 194 open modes (files), 203 OpenFile( ) function, 207 operating system, 420-422 entry point, 422-429 initialization subroutines, 429-438 program listings end of initialization, 429 initialization subrou- tines, 429-432 initialize call gates and IDT, 433-438 operating system initialization, 427-429 operating system initialization and entry point, 423-427 VIRTUAL command, 422-429 operating systems calling stacks, 131-134 device drivers (functions), 158 program listings (main operating system data), 420-422 protection, 134-135 OutByte( ) call, 249 OutDWord( ) call, 249 OutWord( ) call, 250 Page Allocation Map (PAM), 71 paged flat memory, 58 paging memory allocating linear, 76 physical, 77 deallocating linear, 76-77 directories (PDs), 72-76 mapping, 73-75 tables, 72 PAM (Page Allocation Map), 77 parallel I/O, 85 Parallel.C (MMURTL source file), 330 parameters (public calls), 222-223 Path command (Set File-Access Path), 269 PDs (page directories), 72-76 Pentium microprocessors, 6 performance monitoring, 162-163 physical memory, 56 allocating, 77 tracking, 63-69 physical sector numbers (FAT), 592 PICU (Priority Interrupt Controller Unit), 98 pipes (IPC), 44 pointers CM32, 704 memory, 78-79 portability, procedural interfaces (API), 119 preemptive multitasking, 27,32 prefixes (DASM assembler), 678-679 preprocessor commands (C language), 702 Print application, 324 procedural interfaces API, 116-120 calling, 117-118 error handling, 119 hardware, 118-119 portability, 119 files, 206 keyboard, 563-565

routines (keyboard) B processors 386,6 486,6 debugger, 185-188 Pentium, 6 protecting memory, 70 operating systems, 134-135 PTs (page tables), 72 public calls, 222 device drivers, 225 I/O, 226 interrupts, 226-227 jobs, 224-225 keyboard, 227 memory, 225-226, 394-404 AddGDTCallGate( ), 394-395 AddIDTGate(), 395-396 AliasMemO, 397-400 AUocOSPage(), 396-397 DeAliasMem( ), 400-401 DeAUocMemf), 401-403 GetPhyAddO, 404 Query >MemPages( ), 403-404 messaging, 224 moving data, 226 parameters, 222-223 speakers, 227 stacks, 224 system service, 225 tasks, 225 timers, 226 video, 227 PUBLIC declarations (DASM assembler), 677 public kernel functions, 348-375 AllocExchO, 370-371 CheckMsg( ), 363-366 DeAllocExchO, 371-373 GetPriority( ), 374-375 GetTTSExch( ), 373 ISendMsg( ), 357-359 MoveRequest( ), 354-355 NewTask( ), 366-368 RequestO, 348-351 RespondO, 351-353 SendMsg( ), 355-357 SetPriority( ), 374 SpawnTask( ), 368-370 WaitMsg( ), 359-363 PutVidAttrs( ) call, 250, 580 PutVidChars ( ) function, 138 PutVidChars( ) call, 250-251, 580 QueryMemPages( ) call, 403-404 QueryPages( ) call, 251 QueryPages( ) function, 134 RD command (Remove Directory), 269 Read Keyboard( ) function, 191 ReadBlock( ) function, 208 ReadBytes( ) function, 209 ReadCMOSO call, 251 reading files, 220 ReadKbd ( ) call, 251-252 ReadKbd( ) function, 138 real-time, 7 scheduling tasks, 35-36 reclaiming resources, 440-469 reentrancy (multitasking), 51-53 RegisterSvc( ) call, 252 RemoveRdyJob function, 342-344 Rename command (files), 270 RenameFile( ) function, 214 request blocks system services, 144-145 caller information, 145-150 service code, 145 Request( ) call, 252-253 Request ( ) function, 49, 135, 144, 348-351 requests (file system), 204-205 resources (reclamation), 440-469 Respond( ) call, 254 Respond! ) function, 49, 144, 351-353 ROM (Read Only Memory), 100-110 routines (keyboard), 568-570

0 RQBCodeASM (MMURTL source file) RQBCodeJVSM (MMURTL source file), 330 RS-232 asynchronous device driver, 519-540 program listings device driver (listing 24.10), 525 device driver (listing 24.11), 526 device driver (listing 24.12), 526-528 device driver (listing 24.13), 528-535 device driver (listing 24.14), 535-540 device driver (listing 24.8), 521-523 device driver (listing 24.9), 523-525 header file, 519-520 RS232.C (MMURTL source file), 330 Run command, 270 s scheduling tasks, 32-39 combining techniques, 36-38 cooperative queueing, 34 models, 38-40 prioritized cooperative, 34 real-time, 35-36 time slicing, 33-35 screen editor, 288 ScrolIVid( ) call, 254 Scroll Vid( ) function, 575, 582 sectors boot ROM, 101-110 FAT (File Allocation Table) boot, 593 hidden, 592 initializing, 593 LBA (Logical Block Address), 592-593 physical sector numbers, 592 segmented memory, 61-62, 71 semaphores (IPC), 43-44 send( ) function, 44 SendAbort function, 346-347 SendMsg ( ) call, 254-255 SendMsg( ) function, 46, 135, 355-357 serial I/O, 84-85 service code (request blocks), 145 SetCmdLine( ) call, 255 SetCmdLine( ) function, 448 SetExchOwner( ) function, 345-346 SetExitJob( ) call, 255-256 Set£xitJob( ) function, 137, 448 SetFileLFA( ) function, 211 SetFileSize( ) function, 213 SetIRQVector( ) call, 256-257 SetIRQVector( ) function, 150, 158 SetJobName( ) call, 257 SetJobName( ) function, 137 SetNormVid( ) call, 257-258 SetNormVid( ) function, 575 SetPath( ) call, 258 SetPath( ) function, 137, 448 SetPriority( ) call, 258 SetPriority( ) function, 374 SetSysIn( ) call, 258-259 SetSysIn( ) function, 137 SetSysOut( ) call, 259 SetUpDMA( ) function, 89 SetUserName( ) call, 259 SetUserName( ) function, 137, 448 SetVidOwner( ) call, 259-260, 574 SetXY( ) call, 260 SetXY( ) function, 585 shift right function (CM32), 706-707 shift-states (keyboard), 193-194 simple flat memory, 57-58 single tasking, 30 single user tasks, 28-29 Sleep( ) call, 260 Sleep( ) function, 151,406 timer, 410-411 software 32-bit, 130-131 tasks. 29 source code borrowing, 333

time slicing (scheduling tasks) F39 calling conventions, 328 comments, 328 debugger, 473-496 kernel, 336-337 MMURTL, 328-331 modular, 332 SpawnTask( ) call, 261 SpawnTaski ) function, 46, 136, 368-370 speakers (public calls), 227 stacks calling operating systems, 132-134 public calls, 224 standard interval (timer), 406-407 starting tasks (multitasking), 136 statements (C language), 701-702 static variables (CM32), 704-706 statistics, 162-163 storage classes (C language), 701-702 DASM assembler, 675-676 Stream mode (files), 204 structures, 112 CM32, 706 dynamic, 114 subroutines initialization, 429-438 job management, 440-447 SVCCodeASM (MMURTL source file), 330 synchronization (IPC), 42 system resources (device drivers), 150-151 system services asynchronous, 146 errors, 146-147 keyboard, 190-192, 557-563 NAssign Keyboard( ) function, 192 Notify on Global Keys( ) function, 191-192 Read Keyboard function, 191 messages, 142-147 initialling, 142 listing 10.1, 143-144 request blocks, 144-145 program listings, 322-324 Simple Service source code, 322-324 TestSvc.C, 324 public calls, 225 systems programming (API), 120-125 device drivers, 120-125 calling drivers, 124-125 calling operating system, 122-124 internal calls, 120 tables dynamic, 114 memory, 68 paging, 72 static, 112 tagged fields (executable files), 689 Task State Segment (TSS), 74 tasks, 26-30 CPU time, 30-32 hardware, 29-30 initializing, 1 12 IPC, 42-51 messages, 44-54 pipes, 44 semaphores, 43-44 synchronization, 42 kernel, 47 multitasking, 31-36 cooperative, 31-32 preemptive, 32 public calls, 225 scheduling, 32-39 combining techniques, 36-38 cooperative queueing, 34 models, 38-40 prioritized cooperative, 34 real-time, 35-36 time slicing, 33-35 single, 30 software, 29 starting, 136 structures, 112 tables (static), 112 users multiple, 28-29 single, 28-29 TestSvc.C (program listing), 324 threads, see tasks th unking, 19 time slicing (scheduling tasks), 33-35

H timer device drivers, 151 functions Alarm(), 411-412 BeepO, 417-418 Beep_Work(), 416-417 GetCMOSDate( ), 415-416 GetCMOSTime( ), 414-415 GetTimerTick( ), 416 KillAlarmO, 412-413 MicroDelayO, 413-414 SleepO, 410-411 Tone(), 418 interrupts, 408-418 hardware, 97-98 program listings code for Alarm( ) function, 412 code for sleep function, 411 code for the Micro Delay ( ‘) function, 4 14 code producing beeps, 418 code producing tones, 418 code reading CMOS time, 414-415 code returning timer ticks, 416 data and constants for timer, 407-408 helper function for Beep() and Tone( ), 417 bop in timer ISR, 406-407 timer interrupts, 409-410 standard interval, 406-407 public calls, 226 TmrCodcASM (MMURTL source file), 330 Tone( ) call, 261-262 Tone( ) function, 418 tracking memory linear, 63-68 linked lists, 63-68 physical, 63-69 transferring data (block- oriented devices), 85-86 translating keyboard information, 551-556 TSS (Task State Segment), 74 TTYOut ( ) call, 262 TTYOut( ) function, 577 type conversion (CM32), 704 u

UARTs (Universal Asynchronous Receiver Transmitters), 84 UASM.ASM (MMURTL source file), 329 UnMarkPage function, 384 UnMasklQR ( ) call, 262-263 UnMaskIRQ( ) function, 150, 158 UnRegisterSvc( ) call, 263 user tasks, 28-29 VGA text mode (video), 572 video, 138-140, 573-589 hardware, 87-89 program listings code for TTY stream output to screen, 578-579 code to clear screen, 577 code to edit lines on screen, 587-589 code to get characters and attributes, 582 code to get current video owner, 576-577 code to place characters, 581 code to return to cursor position, 586 code to screen video attributes, 580 code to scroll area of screen, 582-584 code to set cursor position, 585 code to set cursor position, 585-586 code to set normal video attribute, 576 code to set normal video attribute, 576 code to set video owner, 574-575 initializing video, 574 video constants and data, 573 public calls, 227 VGA text mode, 572 virtual, 572

writing H VidecASM (MMURTL source file), 329 VIRTUAL command, 422-429 virtual memory, 8 virtual paged memory, 59-60 virtual video, 572 w-z wait( ) function, 44 WaitMsg( ) call, 263 WaitMsg( ) function, 46, 135, 359-363 WriteBlock( ) function, 209 WriteBytes( ) function, 210 writing device drivers, 147-158 calling, 149 DMA, 151 installing, 149-150 interrupts, 150-151 system resources, 150-151 theory, 148 timers, 151 files, 220

Add to Your Sams Library Today with the Best Books for Programming, Operating Systems, and New Technologies The easiest way to order is to pick up the phone and call 1-800-428-5331 between 9:00 a.m. and 5:00 p.m. EST. For faster service please have your credit card available. ISBN Quantity- Description of Item Unit Cost Total Cost 0-672-48470-6 Assembly Language: For Real Programmers Only! (Book/Disk) $44.95 0-672-30286-1 C Programmer's Guide to Serial Communications, Second Edition $39.95 0-672-30050-8 C Programmer's Guide to NetBIOS, IPX, and SPX (Book/Disk) $49.95 0-672-30475-9 PC Programmer's Guide to Low-Level Functions and Interrupts (Book/Disk) $45.00 0-672-30364-7 Win32 API Desktop Reference (Book/CD-ROM) $49.95 0-672-30471-6 Teach Yourself Advanced C in 21 Days (Book/Disk) $34.95 0-56686-127-6 The Winn L. Rosch Hardware Bible, Third Edition $35.00 0-672-30624-7 Peter Norton's Inside the PC, Sixth Edition $35.00 0-672-30291-8 DOS 6 Developer's Guide (Book/Disk) $39.95 0-672-22789-4 The Waite Group's MS-DOS Bible, 4th Edition $29.95 0-672-30501-1 Understanding Data Communications, 4th Edition $29.99 0-672-30160-1 Multimedia Developer's Guide (Book/Disk) $49.95 0-672-30309-4 Programming Sound for DOS and Windows (Book/Disk) $39.95 □ 3 Vi” Disk Shipping and Handling: See information below. □ 5 lA” Disk TOTAL Shipping and Handling: $4.00 for the first book, and $ 1 .75 for each additional book. Floppy disk: add $ 1 .75 for shipping and handling. If you need to have it NOW, we can ship product to you in 24 hours for an additional charge of approximately $18.00, and you will receive your item overnight or in two days. Overseas shipping and handling adds $2.00 per book and $8.00 for up to three disks. Prices subject to change. Call for availability and pricing information on latest editions. 1-800-428-5331 201 W. 103rd Street, Indianapolis, Indiana 46290 Orders 1-800-835-3202 — FAX 1-800-858-7674 Customer Service

GET CONNECTED to the ultimate source of computer information! The MCP Forum on CompuServe Go online with the world's leading computer book publisher! Macmillan Computer Publishing offers everything you need for computer success! Find the books that are right for you! A complete online catalog, plus sample chapters and tables of contents give you an in-depth look at all our books. The best way to shop or browse! V Get fast answers and technical support for MCP books and software

  • Join discussion groups on major computer subjects • Interact with our expert authors via e-mail and conferences ^ Download software from our immense library: Source code from books Demos of hot software The best shareware and freeware Graphics files mm jhhh Macmillan Computer Publishing I .S.A. Que College Alpha Hayden Brady Adobe Press Macmillan Comp Publ+ Forum V 0 Join now and get a free CompuServe Starter Kit! To receive your free CompuServe Intro- ductory Membership, call 1-800-848- 8199 and ask for representative #597. The Starter Kit includes: Personal ID number and password • $15 credit on the system ■ Subscription to CompuServe Magazine :M MACMILLAN COMPUTER PUBLISHING Once on the CompuServe System, type: GO MACMILLAN for the most computer information anywhere! ‘^.CompuServe

PLUG YOURSELF INTO... The Macmillan Information SuperLibrary” Free information and vast computer resources from the world's leading computer book publisher — online! FIND THE BOOKS THAT ARE RIGHT FOR YOU! A complete online catalog, plus sample chapters and tables of contents give you an in-depth look at a// of our books, including hard-to-find titles. It's the best way to find the books you need! • STAY INFORMED with the latest computer industry news through our online newsletter, press releases, and customized Information SuperLibrary Reports. • GET FAST ANSWERS to your questions about MCP books and software. • VISIT our online bookstore for the latest information and editions! • COMMUNICATE with our expert authors through e-mail and conferences. • DOWNLOAD SOFTWARE from the immense MCP library:

  • Source code and files from MCP books
  • The best shareware, freeware, and demos • DISCOVER HOT SPOTS on other parts of the Internet. • WIN BOOKS in ongoing contests and giveaways! TO PLUG INTO MCP: GOPHER gopher.mcp.com FTP: ftp.mcp.com WORLD WIDE WEB: http://www.mcp.com H-i

Installing Your CD-ROM

What's on the CD-ROM The CD-ROM contains the complete MMURTL operating system source code; sample applications, including source cede; a 32-bit ^ssei nbler, including source code; and a 32-bit C compiler, including source code. Installing the CD-ROM Insert the disc in your CD-ROM drive and follow the'p <;‘aos to in” " -software. The install program enables you r^ ;“sr-\ll a)’ “»f need. You'll need at least 20M ar e fn- rh installation.

  1. From the DOS t ^^ iwc that contains the CD-ROM. For example, if the disk is in drive D:, type D: and press Enter.
  2. Type INSTALL and press Enter.
  3. The install program gives you the option to install all the software on the CD-ROM or only the parts you need. Use the up arrow and down arrow keys to highlight your choice on the menu and press Enter.
  4. After installing the software, press the Esc kev to exit the install program. Read the file README.TXT on the CD-ROM for more information on the files that are installed. Chapter 1, “Overview,” explains how to start using the software.

By opening this package, you are agreeing to be bound by the following agreement: This software product is copyrighted, and all rights are reserved by the publisher and author. You are licensed to use this software on a single computer. You may copy and/or modify the software as needed to facilitate your use of it on a single computer. Making copies of the software for any other purpose is a violation of United States copyright laws. This software is sold as is without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Neither the publisher nor its dealers or distributors assumes any liability for any alleged or actual damages arising from the use of this pro- gram. (Some states do not allow for the exclusion of implied warranties, so the exclusion may not apply to you.)

companion CD-ROM contains Complete source code for a 32-bit operating system (MMURTL) 32-bit C compiler 32-bit assembler Sample/test programs tor MMURTL With Developing Your Own 32-Bit Operating System, you'll Learn the intricacies of 32-bit programming Gain an understanding of 32-bit operating systems Learn about real-time, multitasking operating systems Master MMURTL, the example 32-bit operating system included on the CD-ROM User Level Category: Programming s Covers: 32-Bit Programming Developing Your Own 32-BIT ' Operating System This tutorial builds upon an intermediate programmer's knowledge and explains how to design and develop a feature-rich operating system. With Developing Your Own 32-Bit Operating System, you'll not only get the theory behind basic operating system design, but also learn how to build your own operating system from scratch. Meet MMURTL, a full-featured, 32-bit, message-based, multitasking, real-time operating system that you can modify and use. In addition to learning how to program an operating system, you'll gain a general understanding of 32-bit programming and how other 32-bit operating systems work. Developing Your Own 32-Bit Operating System prepares you for the future in 32-bit systems programming. Richard A. Burgess is a retired U.S. Coast Guard commissioned officer. He taught computer electronics technology at the Computer Learning Center in Washington D.C. for two years, and he consulted in and around Washington with The D-Group. Currently, he is the Chief Information Officer with Optipat, Inc., a rapidly growing, high-technology, patent, trademark, and copyright imaging firm. $49.99 USA $67.99 CAN £39.50 Net UK (inc of VAT) sAms PUBLISHING 780672"306556

Powered by TurnKey Linux.