DOS 6-XL Reference
Total Page:16
File Type:pdf, Size:1020Kb
Embedded DOStm 6-XL The Full-Featured DOS for Embedded Systems Developer's Guide with Command Reference General Software, Inc. P.O. Box 2571 Redmond, Washington 98073 Tel (206) 454-5755 FAX (206) 454-5744 BBS (206) 454-5894 Email: [email protected] Copyright (C) 1990-1996 General Software, Inc. All rights reserved. Notices EMBEDDED DOS 6-XL Developer's Guide IMPORTANT NOTICES General Software, the GS logo, EMBEDDED DOS 6-XL, Embedded BIOS, Embedded LAN, CodeProbe, The Snooper, EtherProbe, and Booter Toolkit are trademarks of General Software, Inc. IBM, PC-DOS, Microsoft, MS, MS-DOS, OS/2, Digital Research, DR-DOS, Novell, NetWare, and VAX/VMS are trademarks of their respective holders. Important Licensing Information 1. EMBEDDED DOS 6-XL is licensed for use as an operating system for embedded systems. It is not licensed for use as a general purpose desktop operating system where the end user has control over which third party programs are run on the target system. 2. The source, object, and executable software provided with General Software's Adaptation Kits involve valuable copyright, trade secret and other proprietary rights of General Software, Inc. No title to or ownership of the software, or the proprietary rights associated with the software, is transferred to you with this package. 3. General cannot possibly anticipate the end applications in which EMBEDDED DOS 6-XL is used, and cannot be certain that all methods used to develop software for MS-DOS are truly portable to the EMBEDDED DOS 6-XL environment. ACCORDINGLY, YOU ACCEPT THE SOFTWARE 'AS IS' AND WAIVE AND RELEASE ALL REPRESENTATIONS, WARRANTIES AND LIABILITIES OF GENERAL SOFTWARE, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE, WITH RESPECT TO THE SOFTWARE, INCLUDING BUT NOT LIMITED TO ANY: (A) IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE; (B) IMPLIED WARRANTY ARISING FROM COURSE OF PERFORMANCE, COURSE OF DEALING OR USAGE OF TRADE; (C) CLAIM OF INFRINGEMENT; OR (D) ANY OBLIGATION, LIABILITY, RIGHT, REMEDY OR CLAIM IN TORT, NOTWITHSTANDING ANY FAULT, NEGLIGENCE, STRICT LIABILITY, OR PRODUCT LIABILITY OF GENERAL (WHETHER ACTIVE, PASSIVE OR IMPUTED). Intro EMBEDDED DOS 6-XL Developer's Guide iii TABLE OF CONTENTS ABOUT THIS DEVELOPMENT KIT 1 INTRODUCTION 2 INTRODUCTION TO EMBEDDED DOS 6-XL 2 GETTING HELP WITH RELATED EMBEDDED PRODUCTS 3 RELATED READING 3 BOOTING EMBEDDED DOS 6-XL 5 RUNNING AN EMBEDDED APPLICATION 5 THE STANDARD COMMAND.COM 5 ENABLING/DISABLING THE TASK BAR 5 ADDITIONAL COMMANDS IN COMMAND.COM 6 THE TINY COMMAND.COM 6 RUNNING WITHOUT COMMAND.COM 6 RUNNING FROM CONFIG.SYS 6 CONFIGURING EMBEDDED DOS 6-XL 8 GENERAL FORMAT OF THE CONFIG.SYS FILE 8 CONFIG.SYS COMMANDS 8 DEVICE DRIVER REFERENCE 12 ANSI.SYS DRIVER 12 DEBUG.SYS DRIVER 12 IFSFUNC.SYS DRIVER 13 RAMDISK.SYS DRIVER 13 SERDRIVE.SYS DRIVER 14 USER COMMAND REFERENCE 17 BASIC USER CONCEPTS 17 FILES, DIRECTORIES, AND FILENAMES 17 WILDCARDED FILENAMES 18 PATHNAMES 19 THE CURRENT DIRECTORY 19 THE CURRENT DRIVE 20 PUTTING IT ALL TOGETHER 20 SPECIAL FILENAMES 21 STARTING AN EMBEDDED DOS 6-XL SESSION 22 General Software EMBEDDED DOS 6-XL Developer's Guide iv EMBEDDED DOS 6-XL Developer's Guide Intro ENDING AN EMBEDDED DOS 6-XL SESSION 23 THE EMBEDDED DOS 6-XL COMMAND SHELL 23 REDIRECTION 23 PIPING 24 THE ENVIRONMENT SPACE 25 PROGRAM SEARCH PATH 25 BATCH FILES 26 ALPHABETICAL LIST OF COMMANDS 27 : COMMAND 27 @ COMMAND 28 ASK COMMAND 28 ATTRIB COMMAND 29 BATCH FILES 30 BREAK COMMAND 31 CALL COMMAND 32 CHDIR COMMAND 32 CHKDSK COMMAND 33 CLOSE COMMAND 35 CLS COMMAND 35 COMMAND COMMAND 36 COPY COMMAND 37 CTTY COMMAND 38 DATE COMMAND 39 DEL COMMAND 39 DELAY COMMAND 40 DELTREE COMMAND 41 DIR COMMAND 41 DISKCOMP COMMAND 43 DISKCOPY COMMAND 44 ECHO COMMAND 45 ERASE COMMAND 46 EXIT COMMAND 47 FDISK COMMAND 47 FIND COMMAND 48 FOR COMMAND 49 FORMAT COMMAND 50 GOTO COMMAND 51 HELP COMMAND 52 IF COMMAND 53 INTERSVR COMMAND 54 LABEL COMMAND 55 LOADHI COMMAND 56 MEM COMMAND 56 MKDIR COMMAND 57 MODE COMMAND 58 MORE COMMAND 60 OPEN COMMAND 61 PATH COMMAND 61 PAUSE COMMAND 62 General Software EMBEDDED DOS 6-XL Developer's Guide Intro EMBEDDED DOS 6-XL Developer's Guide v PROMPT COMMAND 63 READ COMMAND 64 REM COMMAND 65 RENAME COMMAND 65 REWIND COMMAND 66 SET COMMAND 67 SHIFT COMMAND 68 SMARTDRV COMMAND 69 SORT COMMAND 69 SWITCH COMMAND 70 SYNCH COMMAND 71 SYS COMMAND 71 TIME COMMAND 72 TREE COMMAND 73 TYPE COMMAND 73 VER COMMAND 74 VERIFY COMMAND 74 VOL COMMAND 75 WRITE COMMAND 75 XCOPY COMMAND 76 WRITING REAL-TIME APPLICATIONS 79 USING COMPILERS, LINKERS, AND ASSEMBLERS 79 DOS INT 21H FUNCTIONS 81 C RUNTIME LIBRARY FUNCTIONS 81 3RD-PARTY LIBRARY FUNCTIONS 82 EMBEDDED DOS 6-XL KERNEL SERVICES 83 CALLING KERNEL FUNCTIONS FROM ASSEMBLY LANGUAGE 83 CALLING KERNEL FUNCTIONS FROM C84 CALLING KERNEL FUNCTIONS FROM OTHER HLLS 85 CALLING I/O HELPER FUNCTIONS 85 Calling I/O Helper Functions From Assembly Language 85 Calling I/O Helper Functions From C 88 EMBEDDED DOS 6-XL EXECUTIVE SERVICES 89 CALLING MESSAGE PORT FUNCTIONS 90 CALLING QUEUE FUNCTIONS 92 CALLING SHARED MEMORY FUNCTIONS 94 CALLING HANDLE MANAGER FUNCTIONS 95 MULTITASKING 98 LIGHTWEIGHT THREAD MODEL 98 PRIORITIZED SCHEDULING 107 USING TIMERS FOR SYNCHRONOUS EXECUTION 109 PREEMPTIVE AND NONPREEMPTIVE SCHEDULING 111 SYSTEM-WIDE CRITICAL SECTIONS 112 GUARDING CRITICAL CODE/DATA WITH MUTEXES 112 INTERRUPT SERVICE ROUTINES 116 USING YOUR C COMPILER AND RUNTIME LIBRARY 119 General Software EMBEDDED DOS 6-XL Developer's Guide vi EMBEDDED DOS 6-XL Developer's Guide Intro Assumptions About SS and DS 119 Stack Probes 120 Runtime Library Reentrancy 121 Using Embedded DOS With Modula-2 and Ada 121 KERNEL API 123 THREAD OBJECT 124 ALLOCATETHREAD 124 ALLOCATETHREADLONG 125 DEALLOCATETHREAD 126 ABORTTHREAD 127 PRIORITIZETHREAD 128 QUERYTHREADHANDLE 129 QUERYTHREADINFORMATION 129 SETTHREADINFORMATION 131 ENTERCRITICALSECTION 133 LEAVECRITICALSECTION 133 PASSTIMESLICE 134 EVENT OBJECT 134 ALLOCATEEVENT 134 DEALLOCATEEVENT 135 SETEVENT 136 CLEAREVENT 136 PULSEEVENT 137 QUERYEVENT 138 WAITEVENT 138 MUTEX OBJECT 139 ALLOCATEMUTEX 139 DEALLOCATEMUTEX 140 ACQUIREMUTEX 141 RELEASEMUTEX 141 SPINLOCK OBJECT 142 ALLOCATESPINLOCK 143 DEALLOCATESPINLOCK 143 ACQUIRESPINLOCK 144 RELEASESPINLOCK 144 TIMER OBJECT 145 ALLOCATETIMER 145 DEALLOCATETIMER 146 STARTTIMER 147 STOPTIMER 147 POOL OBJECT 148 ALLOCATEPOOL 149 DEALLOCATEPOOL 149 KEEPPOOL 150 ADDRESSABILITY FUNCTIONS 151 GETFSHELPADDRESS 151 General Software EMBEDDED DOS 6-XL Developer's Guide Intro EMBEDDED DOS 6-XL Developer's Guide vii GETIOHELPADDRESS 152 GETDOSDATADS 153 GETDOSDATAES 153 GETDGROUPDS 154 GETDGROUPES 154 GETPSPDS 155 GETPSPES 155 NAMED OBJECTS 156 ALLOCATEOBJECT 156 ACCESSOBJECT 157 DEALLOCATEOBJECT 158 RELEASEOBJECT 159 LOCKOBJECT 159 UNLOCKOBJECT 160 POINTTOOBJECT 161 EXECUTIVE API 163 ACCESS TO EXECUTIVE SERVICES 163 MESSAGE PORT SERVICES 163 EXCREATEMSGPORT 164 EXOPENMSGPORT 164 EXCLOSEMSGPORT 165 EXSENDMSG 165 EXRECEIVEMSG 166 QUEUEING SERVICES 168 EXCREATEQUEUE 168 EXOPENQUEUE 168 EXCLOSEQUEUE 169 EXPUSHQUEUE 169 EXAPPENDQUEUE 170 EXPOPQUEUE 170 DEBUGGING WITH DEBUG.SYS 173 KERNEL SYMBOLS FOR DOS.SYS 174 SETTING BREAKPOINTS 178 STEPPING THROUGH ROM CODE 178 TRAPPING ON ILLEGAL WRITES TO DATA 178 INTERACTING WITH THE DEBUGGER 179 OBJECT DISPLAY COMMANDS 179 TIMER COMMAND 179 EVENT COMMAND 180 MUTEX COMMAND 180 THREAD COMMAND 181 SPINLOCK COMMAND 181 ARENA COMMAND 182 General Software EMBEDDED DOS 6-XL Developer's Guide viii EMBEDDED DOS 6-XL Developer's Guide Intro DEV COMMAND 182 FSD COMMAND 183 SHTE COMMAND 183 SDTE COMMAND 184 FSRP COMMAND 184 IORP COMMAND 184 DDE COMMAND 185 BPB COMMAND 185 SPE COMMAND 186 FFO COMMAND 186 SFD COMMAND 187 FCB COMMAND 187 OTHER COMMANDS 187 REBOOT COMMAND 188 CONSOLE COMMAND 188 DOSDATA COMMAND 188 HELP COMMAND 189 + COMMAND 189 - COMMAND 190 G COMMAND 190 R COMMAND 190 T COMMAND 191 U COMMAND 191 E COMMAND 192 I COMMAND 192 O COMMAND 193 BP COMMAND 193 BC COMMAND 193 BL COMMAND 194 WP COMMAND 194 D COMMAND 195 DB COMMAND 195 DW COMMAND 196 DD COMMAND 196 PROGRAMMED OUTPUT FORMATTING 197 INT DBGINT (2CH) OUTPUT FORMATTING API 197 KPRINTF/DPRINTF OUTPUT FORMATTING MACROS 198 Literal Specifications 198 Format Specifications 199 $c Format Specification 199 $b Format Specification 200 $x Format Specification 200 $u Format Specification 200 $d Format Specification 201 $lx Format Specification 201 $lu Format Specification 201 $ld Format Specification 201 $s Format Specification 201 $s$ Format Specification 203 General Software EMBEDDED DOS 6-XL Developer's Guide Intro EMBEDDED DOS 6-XL Developer's Guide ix $s[n] Format Specification 203 TROUBLESHOOTING 205 ADVANCED TROUBLESHOOTING 205 COMMAND.COM ISSUES 205 CONFIG.SYS ISSUES 206 FILE SYSTEM ISSUES 206 MULTITASKING ISSUES 207 PERFORMANCE ISSUES 207 RAM CRAM ISSUES 208 REENTRANCY ISSUES 208 RS-232 COMMUNICATIONS ISSUES 209 UTILITY PROGRAM ISSUES 209 STACK OVERFLOW ISSUES 210 SYNTAX ERROR MESSAGES 210 UNEXPECTED APPLICATION CRASHES 210 ERROR MESSAGES 211 General Software EMBEDDED DOS 6-XL Developer's Guide Intro EMBEDDED DOS 6-XL Developer's Guide 1 ABOUT THIS DEVELOPMENT KIT Thank you for choosing General Software's EMBEDDED DOS 6-XL operating system for use in your embedded system. This version of DOS offers a superior combination of embedded features, performance, and MS-DOS compatibility that will satisfy your needs for both a ROM- able DOS operating system, and even a real-time kernel. General Software EMBEDDED DOS 6-XL Developer's Guide 2 EMBEDDED DOS 6-XL Developer's Guide Intro Chapter 1 INTRODUCTION Introduction to EMBEDDED DOS 6-XL EMBEDDED DOS 6-XL is a high-performance, full-featured, ROM-able operating system specifically designed for use in embedded systems. In addition to providing compatibility with the majority of desktop software (such as Windows 3.1, Norton Utilities, or Brief, for example), it offers real-time multitasking functionality that comes as an integrated part of the operating system, so that real-time applications can be built using DOS tools.