- Timestamp:
- Nov 1, 1999, 12:57:09 AM (26 years ago)
- Location:
- trunk/src/win32k
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/dev16/d16init.c
r1467 r1535 1 /* $Id: d16init.c,v 1. 2 1999-10-27 02:02:53bird Exp $1 /* $Id: d16init.c,v 1.3 1999-10-31 23:57:00 bird Exp $ 2 2 * 3 3 * d16init - init routines for both drivers. … … 94 94 else 95 95 { 96 /* FIXME quiet test! */ 96 97 register NPSZ npsz = "Win32k.sys succesfully initiated!\n\r"; 97 98 DosPutMessage(1, strlen(npsz)+1, npsz); -
trunk/src/win32k/dev16/probkrnl.c
r1467 r1535 1 /* $Id: probkrnl.c,v 1. 2 1999-10-27 02:02:53bird Exp $1 /* $Id: probkrnl.c,v 1.3 1999-10-31 23:57:01 bird Exp $ 2 2 * 3 3 * Description: Autoprobes the os2krnl file and os2krnl[*].sym files. … … 6 6 * 16-bit inittime code. 7 7 * 8 * All data has to be initiated because this file is to be compiled into assembly, 9 * automaticly modified and run thru an assembler to produce an object-file. This 10 * because there is no other known way to combine 32-bit and 16-bit C/C++ code into 11 * the same device driver which works. 8 * All data has to be initiated because this is 16-bit C code 9 * and is to be linked with 32-bit C/C++ code. Uninitiazlied 10 * data ends up in the BSS segment, and that segment can't 11 * both be 32-bit and 16-bit. I have not found any other way 12 * around this problem that initiating all data. 12 13 * 13 14 * How this works: … … 86 87 }; 87 88 88 unsigned long int fInitSuccess = 0;89 89 unsigned long int ulBuild = 0; 90 90 unsigned short usVerMajor = 0; … … 96 96 */ 97 97 static int fQuiet = 0; 98 99 98 static char szUsrOS2Krnl[50] = {0}; 100 99 static char szOS2Krnl[] = {"c:\\os2krnl"}; … … 917 916 /** 918 917 * "main" function. 918 * Note that the option -Noloader causes nothing to be done. 919 919 * @returns 0 on success, something else on error. 920 920 * @param pReqPack Pointer to init request packet 921 921 * @remark 922 * @result init_success923 922 */ 924 923 int ProbeKernel(PRPINITIN pReqPack) … … 943 942 { 944 943 i++; 945 if (pReqPack->InitArgs[i] == 'V' || pReqPack->InitArgs[i] == 'v') 946 fQuiet = 0; 947 else if (pReqPack->InitArgs[i] == 'Q' || pReqPack->InitArgs[i] == 'q') 948 fQuiet = 1; 949 else if (pReqPack->InitArgs[i] == 'K' || pReqPack->InitArgs[i] == 'k') 950 { /* kernel file */ 951 i++; 952 i += kargncpy(szUsrOS2Krnl, &pReqPack->InitArgs[i], sizeof(szUsrOS2Krnl)); 953 } 954 else if (pReqPack->InitArgs[i] == 'S' || pReqPack->InitArgs[i] == 's') 955 { /* symbol file */ 956 i++; 957 i += kargncpy(szUsrSym, &pReqPack->InitArgs[i], sizeof(szUsrSym)); 944 switch (pReqPack->InitArgs[i]) 945 { 946 case 'k': 947 case 'K': /* Kernel file */ 948 i++; 949 i += kargncpy(szUsrOS2Krnl, &pReqPack->InitArgs[i], sizeof(szUsrOS2Krnl)); 950 break; 951 952 case 'n': 953 case 'N': /* NoLoader */ 954 return 0; 955 956 case 'q': 957 case 'Q': /* Quiet */ 958 fQuiet = 1; 959 break; 960 961 case 's': 962 case 'S': /* Symbol file */ 963 i++; 964 i += kargncpy(szUsrSym, &pReqPack->InitArgs[i], sizeof(szUsrSym)); 965 break; 966 967 case 'v': 968 case 'V': /* Verbose */ 969 fQuiet = 0; 970 break; 958 971 } 959 972 } … … 1029 1042 dprintf(("rc=%d; i=%d\n", rc, i)); 1030 1043 ShowResult(rc, i); 1031 fInitSuccess = rc = 0;1032 1044 1033 1045 return rc; -
trunk/src/win32k/dev32/d32hlp.asm
r1467 r1535 1 ; $Id: d32hlp.asm,v 1. 2 1999-10-27 02:02:54bird Exp $1 ; $Id: d32hlp.asm,v 1.3 1999-10-31 23:57:02 bird Exp $ 2 2 ; 3 3 ; d32hlp - 32-bit Device Driver Helper Function. … … 39 39 CODE32 segment dword public 'CODE' use32 40 40 assume cs:CODE32, ds:flat, ss:nothing, es:nothing 41 41 .386p 42 42 43 43 ;PVOID D32HLPCALL D32Hlp_VirtToLin(ULONG ulPtr16); /* eax */ … … 101 101 D32Hlp_GetDOSVar proc near 102 102 push bx 103 104 mov cx, ax 105 mov al, dl 106 103 mov ecx, edx 107 104 mov dl, DevHlp_GetDOSVar 108 105 jmp far ptr CODE16:Thunk16_GetDOSVar … … 116 113 117 114 Error: 118 mov ax, 87115 xor eax, eax 119 116 120 117 Finished: -
trunk/src/win32k/dev32/d32init.c
r1467 r1535 1 /* $Id: d32init.c,v 1. 2 1999-10-27 02:02:54bird Exp $1 /* $Id: d32init.c,v 1.3 1999-10-31 23:57:02 bird Exp $ 2 2 * 3 3 * d32init.c - 32-bits init routines. … … 89 89 switch (*pszTmp) 90 90 { 91 case 'c': 91 92 case 'C': /* -C[1|2] - com-port no, def:-C2 */ 92 93 switch (pszTmp[1]) … … 102 103 break; 103 104 105 case 'e': 106 case 'E':/* ELF */ 107 pszTmp2 = strpbrk(pszTmp, ":=/- "); 108 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1 109 && (pszTmp2[1] == 'N' ||pszTmp2[1] == 'n' || pszTmp2[1] == 'D' || pszTmp2[1] == 'd') 110 ) 111 options.fElf = FALSE; 112 else 113 options.fElf = TRUE; 114 break; 115 116 case 'l': 104 117 case 'L': /* -L[..]<:|=| >[<Y..|E..| > | <N..|D..>] */ 105 118 pszTmp2 = strpbrk(pszTmp, ":=/- "); … … 112 125 break; 113 126 114 127 case 'n': 128 case 'N': /* NoLoader */ 129 options.fNoLoader = TRUE; 130 break; 131 132 case 'p': 133 case 'P': /* PE */ 134 pszTmp2 = strpbrk(pszTmp, ":=/- "); 135 if (pszTmp2 != NULL && (*pszTmp == ':' || *pszTmp == '=')) 136 { 137 pszTmp++; 138 if (strnicmp(pszTmp, "pe2lx", 5) == 0) 139 options.fPE = FLAGS_PE_PE2LX; 140 else if (strnicmp(pszTmp, "pe", 2) == 0) 141 options.fPE = FLAGS_PE_PE; 142 else if (strnicmp(pszTmp, "mixed", 2) == 0) 143 options.fPE = FLAGS_PE_MIXED; 144 else if (strnicmp(pszTmp, "not", 2) == 0) 145 options.fPE = FLAGS_PE_NOT; 146 else 147 kprintf(("R0Init32: invalid parameter -PE:...\n")); 148 } 149 else 150 kprintf(("R0Init32: invalid parameter -PE...\n")); 151 break; 152 153 case 'q': 115 154 case 'Q': /* quiet initialization */ 116 155 options.fQuiet = TRUE; 117 156 break; 118 157 158 case 's': 119 159 case 'S': /* SMP kernel */ 120 160 options.fKernel = KF_SMP; 121 161 break; 122 162 163 case 'v': 123 164 case 'V': /* verbose initialization */ 124 165 options.fQuiet = FALSE; 125 166 break; 126 167 168 case 'u': 127 169 case 'U': /* UNI kernel */ 128 170 options.fKernel = KF_SMP; … … 161 203 */ 162 204 /* heap */ 163 if (heapInit( HEAP_SIZE) != NO_ERROR)205 if (heapInit(options.cbHeap) != NO_ERROR) 164 206 return STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL; 165 207 166 208 /* loader */ 167 if (ldrInit() != NO_ERROR) 168 return STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL; 209 if (!options.fNoLoader) 210 if (ldrInit() != NO_ERROR) 211 return STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL; 169 212 170 213 /* functionoverrides */ 171 if (procInit() != NO_ERROR) 172 return STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL; 214 if (!options.fNoLoader) 215 if (procInit() != NO_ERROR) 216 return STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL; 173 217 174 218 return STATUS_DONE; … … 296 340 * or 297 341 * push ebp 298 * mov ecx, dword ptr [ 123407452]342 * mov ecx, dword ptr [xxxxxxxx] 299 343 */ 300 344 -
trunk/src/win32k/include/dev32hlp.h
r847 r1535 1 /* $Id: dev32hlp.h,v 1. 1 1999-09-06 02:19:58bird Exp $1 /* $Id: dev32hlp.h,v 1.2 1999-10-31 23:57:03 bird Exp $ 2 2 * 3 3 * Dev32Hlp - 32-bit Device helpers. … … 53 53 * D32Hlp_GetDOSVar 54 54 */ 55 #define DHGETDOSV_SYSINFOSEG 1UL 56 #define DHGETDOSV_LOCINFOSEG 2UL 57 #define DHGETDOSV_VECTORSDF 4UL 58 #define DHGETDOSV_VECTORREBOOT 5UL 59 #define DHGETDOSV_YIELDFLAG 7UL 60 #define DHGETDOSV_TCYIELDFLAG 8UL 61 #define DHGETDOSV_DOSTABLES 9UL /* undocumented by IBM */ 62 #define DHGETDOSV_DOSCODEPAGE 11UL 63 #define DHGETDOSV_INTERRUPTLEV 13UL 64 #define DHGETDOSV_DEVICECLASSTABLE 14UL 65 #define DHGETDOSV_DMQSSELECTOR 15UL 66 #define DHGETDOSV_APMINFO 16UL 55 /* 0 reserved */ 56 #define DHGETDOSV_SYSINFOSEG 1 57 #define DHGETDOSV_LOCINFOSEG 2 58 /* 3 reserved */ 59 #define DHGETDOSV_VECTORSDF 4 60 #define DHGETDOSV_VECTORREBOOT 5 61 #define DHGETDOSV_YIELDFLAG 7 62 #define DHGETDOSV_TCYIELDFLAG 8 63 #define DHGETDOSV_DOSTABLES 9 /* undocumented */ 64 #define DHGETDOSV_STRP_COMMON 10 /* undocumented */ 65 #define DHGETDOSV_DOSCODEPAGE 11 66 #define DHGETDOSV_INTERRUPTLEV 13 67 #define DHGETDOSV_DEVICECLASSTABLE 14 68 #define DHGETDOSV_DMQSSELECTOR 15 69 #define DHGETDOSV_APMINFO 16 70 #define DHGETDOSV_APM_LENGTH 17 /* undocumented? */ 67 71 68 72 … … 94 98 ULONG ulOffset, 95 99 PPVOID ppvLinAddress); 96 PVOID D32HLPCALL D32Hlp_GetDOSVar(U LONG ulVarNumber, ULONGulVarMember);100 PVOID D32HLPCALL D32Hlp_GetDOSVar(USHORT ulVarNumber, USHORT ulVarMember); 97 101 VOID D32HLPCALL D32Hlp_Yield(VOID); 98 102 PVOID D32HLPCALL D32Hlp_VMAlloc(ULONG flFlags, -
trunk/src/win32k/include/malloc.h
r1467 r1535 1 /* $Id: malloc.h,v 1. 3 1999-10-27 02:02:57bird Exp $1 /* $Id: malloc.h,v 1.4 1999-10-31 23:57:04 bird Exp $ 2 2 * 3 3 * Heap. … … 46 46 #define MAXPTR _uHeapMaxPtr 47 47 48 /*#define HEAP_SIZE 0x00600000U*/ /* 10MB of heap */49 #define HEAP_SIZE 0x100000U /* 1MB of heap */50 51 48 /* HeapPointer assert - old ones... */ 52 49 #define ltasserthp(a) if (!_validptr((void*)(a))){ _ltasserthp((void*)(a), #a,__FILE__,__LINE__); return FALSE;} -
trunk/src/win32k/include/options.h
r1467 r1535 1 /* $Id: options.h,v 1. 2 1999-10-27 02:02:57bird Exp $1 /* $Id: options.h,v 1.3 1999-10-31 23:57:04 bird Exp $ 2 2 * 3 3 * Options. … … 19 19 #define KF_SMP 0x00000001UL 20 20 21 /* fPE */ 22 #define FLAGS_PE_NOT 0x00000000UL 23 #define FLAGS_PE_PE2LX 0x00000001UL 24 #define FLAGS_PE_PE 0x00000002UL 25 #define FLAGS_PE_MIXED 0x00000003UL 26 27 /* ulInfoLevel */ 28 #define INFOLEVEL_QUIET 0x00000000UL 29 #define INFOLEVEL_ERROR 0x00000001UL 30 #define INFOLEVEL_WARNING 0x00000002UL 31 #define INFOLEVEL_INFO 0x00000003UL 32 #define INFOLEVEL_INFOALL 0x00000004UL 33 21 34 /* Set defaults. */ 22 #define SET_OPTIONS_TO_DEFAULT(o) \ 23 o.fQuiet = 0; \ 24 o.usCom = OUTPUT_COM2; \ 25 o.fLogging = 0; \ 26 o.ulBuild = ~0; \ 27 o.fKernel = KF_UNI; \ 28 o.usVerMajor = ~0; \ 29 o.usVerMinor = ~0; 35 #define SET_OPTIONS_TO_DEFAULT(o) \ 36 o.fQuiet = FALSE; \ 37 o.usCom = OUTPUT_COM2; \ 38 o.fLogging = FALSE; \ 39 o.fKernel = KF_UNI; \ 40 o.ulBuild = ~0UL; \ 41 o.usVerMajor = ~0; \ 42 o.usVerMinor = ~0; \ 43 o.fPE = FLAGS_PE_PE2LX; \ 44 o.ulInfoLevel = INFOLEVEL_QUIET;\ 45 o.fElf = FALSE; \ 46 o.fScript = FALSE; \ 47 o.fNoLoader = FALSE; \ 48 o.cbHeap = 0x100000; /* 1MB */ 30 49 31 50 … … 36 55 struct options 37 56 { 38 //*************/39 57 /** @cat misc */ 40 //*************/ 41 BOOL fQuiet; /* quiet initialization */ 58 BOOL fQuiet; /* Quiet initialization. */ 59 60 /** @cat logging options */ 42 61 USHORT usCom; /* Output port no. */ 62 BOOL fLogging; /* Logging. */ 43 63 44 //************************/45 /** @cat logging options */46 //************************/47 BOOL fLogging; /* logging */48 49 //*************************/50 64 /** @cat kernel selection */ 51 //*************************/ 52 ULONG fKernel; /* smp or uni kernel */ 53 ULONG ulBuild; /* kernel build */ 65 ULONG fKernel; /* Smp or uni kernel. */ 66 ULONG ulBuild; /* Kernel build. */ 54 67 USHORT usVerMajor; /* OS/2 major ver - 20 */ 55 68 USHORT usVerMinor; /* OS/2 minor ver - 30,40 */ 56 69 57 //******************************************************/ 58 /** @cat Options affecting the generated LX executable */ 59 //******************************************************/ 60 /* none yet... */ 70 /** @cat Options affecting the generated LX executables */ 71 BOOL fPE; /* Flags set the type of conversion. */ 72 ULONG ulInfoLevel; /* Pe2Lx InfoLevel. */ 73 74 /** @cat Options affecting the generated ELF executables */ 75 BOOL fElf; /* Elf flags. */ 76 77 /** @cat Options affecting the script executables */ 78 BOOL fScript; /* Script flags. */ 79 80 /** @cat Options affecting the script executables */ 81 BOOL fNoLoader; /* No loader stuff. */ 82 83 /** @cat Options affecting the heap. */ 84 ULONG cbHeap; /* Initial heapsize. */ 85 #if 0 86 ULONG cbHeapMax; /* Maximum heapsize. */ 87 ULONG cbHeapResident; /* Initial residentheapsize. */ 88 ULONG cbHeapMaxResident; /* Maxiumem residentheapsize. */ 89 #endif 61 90 }; 62 91 -
trunk/src/win32k/include/yield.h
r847 r1535 1 /* $Id: yield.h,v 1.1 1999-09-06 02:20:00 bird Exp $ 1 /* $Id: yield.h,v 1.2 1999-10-31 23:57:05 bird Exp $ 2 * 2 3 * Yield - conversion may take some time. So it is necessary to 3 4 * check it's time to yield the processor to other processes. … … 13 14 #endif 14 15 15 void Yield(void); 16 17 #ifdef RING0 18 BOOL Yield(void); 19 #else 20 #define Yield() FALSE 21 #endif 22 16 23 17 24 #ifdef __cplusplus -
trunk/src/win32k/ldr/ldr.cpp
r1512 r1535 1 /* $Id: ldr.cpp,v 1. 4 1999-10-29 17:02:34bird Exp $1 /* $Id: ldr.cpp,v 1.5 1999-10-31 23:57:05 bird Exp $ 2 2 * 3 3 * ldr.cpp - Loader helpers. … … 248 248 pMTERoot = NULL; 249 249 250 /* set pe2lx according to quite/verbose */ 251 if (options.fQuiet) 252 Pe2Lx::ulInfoLevel = Pe2Lx::Quiet; 253 else 254 Pe2Lx::ulInfoLevel = Pe2Lx::Info; 250 /* Pe2Lx logging. */ 251 Pe2Lx::ulInfoLevel = options.ulInfoLevel; 255 252 256 253 return rc; -
trunk/src/win32k/ldr/myldrOpen.cpp
r1467 r1535 1 /* $Id: myldrOpen.cpp,v 1. 3 1999-10-27 02:02:58bird Exp $1 /* $Id: myldrOpen.cpp,v 1.4 1999-10-31 23:57:06 bird Exp $ 2 2 * 3 3 * myldrOpen - _ldrOpen. … … 23 23 #include <stdlib.h> 24 24 25 26 25 #include "log.h" 27 26 #include <peexe.h> … … 33 32 #include "ldr.h" 34 33 #include "ldrCalls.h" 34 #include "options.h" 35 35 36 36 … … 52 52 kprintf(("_ldrOpen: phFile=%#.4x, flags=%#.8x, pszFn=%s\n", *phFile, param3, pszFilename)); 53 53 54 if (rc == NO_ERROR )54 if (rc == NO_ERROR && (options.fElf || options.fPE != FLAGS_PE_NOT || options.fScript)) 55 55 { 56 56 static char achBuffer[sizeof(IMAGE_DOS_HEADER)]; 57 57 PIMAGE_DOS_HEADER pMzHdr = (PIMAGE_DOS_HEADER)&achBuffer[0]; 58 PIMAGE_NT_HEADERS pNtHdrs = (PIMAGE_NT_HEADERS)&achBuffer[0]; /* oops. Last accessible field is OptionalHeader.FileAlignment */ 58 59 char *pach = &achBuffer[0]; 59 60 … … 62 63 * This costs up to two disk reads! 63 64 */ 64 rc = _ldrRead(*phFile, 0UL, pMzHdr, 0UL, sizeof( *pMzHdr), NULL);65 rc = _ldrRead(*phFile, 0UL, pMzHdr, 0UL, sizeof(IMAGE_DOS_HEADER), NULL); 65 66 if (rc == NO_ERROR) 66 67 { 67 if (pMzHdr->e_magic == IMAGE_DOS_SIGNATURE && 68 pMzHdr->e_lfanew > sizeof(IMAGE_DOS_HEADER) && pMzHdr->e_lfanew < 0x04000000UL) /* Larger than 64 bytes and less that 64MB. */ 69 { /* MZ header found */ 70 /* read */ 71 rc = _ldrRead(*phFile, pMzHdr->e_lfanew, pMzHdr, 0UL, 4UL, NULL); 68 if ((pMzHdr->e_magic == IMAGE_DOS_SIGNATURE && 69 pMzHdr->e_lfanew > sizeof(IMAGE_DOS_HEADER) && pMzHdr->e_lfanew < 0x04000000UL) /* Larger than 64 bytes and less that 64MB. */ 70 || *(PULONG)pach == IMAGE_NT_SIGNATURE) 71 { /* MZ or PE header found */ 72 if (options.fPE == FLAGS_PE_NOT) 73 return NO_ERROR; 74 75 if (*(PULONG)pach != IMAGE_NT_SIGNATURE) 76 rc = _ldrRead(*phFile, pMzHdr->e_lfanew, pach, 0UL, sizeof(achBuffer), NULL); 77 72 78 if (rc == NO_ERROR && *(PULONG)pach == IMAGE_NT_SIGNATURE) 73 79 { /* PE signature found */ 74 PMODULE pMod;75 76 80 kprintf(("_ldrOpen: PE executable...\n")); 77 #pragma info(none) 78 if (/* invoke pe.exe or do conversion now? */ 1) 79 { /* pe2lx - win32k */ 80 #pragma info(restore) 81 if (options.fPE == FLAGS_PE_PE2LX 82 || (options.fPE == FLAGS_PE_MIXED 83 && !((pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_DLL == 0UL) 84 && pNtHdrs->OptionalHeader.ImageBase >= 0x04000000UL /* 64MB */ 85 ) 86 ) 87 ) 88 { /* pe2lx */ 81 89 Pe2Lx * pPe2Lx = new Pe2Lx(*phFile); 82 90 if (pPe2Lx != NULL) … … 101 109 } 102 110 else 103 { /* pe.exe */ 104 kprintf(("_ldrOpen: pe.exe - opening\n")); 105 _ldrClose(*phFile); 106 rc = _ldrOpen(phFile, "pe.exe", param3); /* path....! problems! */ 107 kprintf(("_ldrOpen: pe.exe - open returned with rc = %d\n", rc)); 108 } 111 if (options.fPE == FLAGS_PE_PE || options.fPE == FLAGS_PE_MIXED) 112 { /* pe.exe */ 113 kprintf(("_ldrOpen: pe.exe - opening\n")); 114 _ldrClose(*phFile); 115 rc = _ldrOpen(phFile, "pe.exe", param3); /* path....! problems! */ 116 kprintf(("_ldrOpen: pe.exe - open returned with rc = %d\n", rc)); 117 return rc; 118 } 109 119 } 110 120 rc = NO_ERROR; … … 112 122 else 113 123 { 114 if (*pach == '#') 115 { 116 /* unix styled script...? must be more than 64 bytes long.... */ 117 char *pszStart = pach+1; 118 char *pszEnd; 119 kprintf(("_ldrOpen: unix script?\n")); 120 /* skip blanks */ 121 while (*pszStart != '\0' && (*pszStart == ' ' || *pszStart == '\t')) 122 pszStart++; 123 if (*pszStart != '\0' && *pszStart != '\r' && *pszStart != '\n') 124 { /* find end-of-word */ 125 while (*pszEnd != '\0' && *pszEnd != '\n' && *pszEnd != '\r' 126 && *pszEnd != '\t' && *pszEnd != ' ') 127 pszEnd++; 128 *pszEnd = '\0'; 129 kprintf(("_ldrOpen: unix script - opening %s\n", pszStart)); 130 _ldrClose(*phFile); 131 rc = _ldrOpen(phFile, pszStart, param3); 132 kprintf(("_ldrOpen: unix script - open returned with rc = %d\n", rc)); 133 } 134 else 135 kprintf(("_ldrOpen: unix script - unexpected end of line/file. (line: %.10s\n", pach)); 136 } 137 else if (pach[0] == ELFMAG0 && pach[1] == ELFMAG1 && pach[2] == ELFMAG2 && pach[3] == ELFMAG3) 124 if (pach[0] == ELFMAG0 && pach[1] == ELFMAG1 && pach[2] == ELFMAG2 && pach[3] == ELFMAG3) 138 125 { 139 126 /* ELF signature found */ 140 127 kprintf(("_ldrOpen: ELF executable! - not implemented yet!\n")); 141 128 } 129 else 130 if (*pach == '#') 131 { 132 /* unix styled script...? Must be more than 64 bytes long? No options. firstline < 64 bytes. */ 133 char *pszStart = pach+1; 134 char *pszEnd; 135 kprintf(("_ldrOpen: unix script?\n")); 136 137 achBuffer[sizeof(achBuffer)-1] = '\0'; /* just to make sure we don't read to much... */ 138 139 /* skip blanks */ 140 while (*pszStart != '\0' && (*pszStart == ' ' || *pszStart == '\t')) 141 pszStart++; 142 if (*pszStart != '\0' && *pszStart != '\r' && *pszStart != '\n') 143 { /* find end-of-word */ 144 while (*pszEnd != '\0' && *pszEnd != '\n' && *pszEnd != '\r' 145 && *pszEnd != '\t' && *pszEnd != ' ') 146 pszEnd++; 147 *pszEnd = '\0'; 148 if (*pszEnd != '\0') 149 { 150 kprintf(("_ldrOpen: unix script - opening %s\n", pszStart)); 151 _ldrClose(*phFile); 152 rc = _ldrOpen(phFile, pszStart, param3); 153 kprintf(("_ldrOpen: unix script - open returned with rc = %d\n", rc)); 154 } 155 } 156 else 157 kprintf(("_ldrOpen: unix script - unexpected end of line/file. (line: %.10s\n", pach)); 158 } 142 159 } 143 160 } -
trunk/src/win32k/misc/vprintf.c
r1467 r1535 1 /* $Id: vprintf.c,v 1. 2 1999-10-27 02:03:00bird Exp $1 /* $Id: vprintf.c,v 1.3 1999-10-31 23:57:07 bird Exp $ 2 2 * 3 3 * vprintf and printf … … 36 36 #include <builtin.h> 37 37 #include "options.h" 38 #include "Yield.h" 38 39 #endif 39 40 … … 215 216 { 216 217 #ifdef RING0 217 if ( options.fQuiet)218 if (!options.fLogging) 218 219 return 0; 219 220 #else … … 413 414 414 415 #ifdef RING0 415 if ( options.fQuiet)416 if (!options.fLogging) 416 417 return 0; 417 418 #endif … … 432 433 433 434 #ifdef RING0 434 if ( options.fQuiet)435 if (!options.fLogging) 435 436 return 0; 436 437 #endif … … 450 451 451 452 #ifdef RING0 452 if ( options.fQuiet)453 if (!options.fLogging) 453 454 return 0; 454 455 #endif … … 490 491 while (!(_inp(options.usCom + 5) & 0x20)); /* Waits for the port to be ready. */ 491 492 _outp(options.usCom, ch); /* Put the char. */ 493 Yield(); 492 494 #else 493 495 DosWrite(1, (void*)&ch, 1, &ulWrote); … … 507 509 static char *strout(char *psz, signed cchMax) 508 510 { 511 int cchYield = 0; 509 512 while (cchMax > 0 && *psz != '\0') 510 513 { … … 536 539 while (!(_inp(options.usCom + 5) & 0x20)); /* Waits for the port to be ready. */ 537 540 _outp(options.usCom, chNewLine); /* Put the char. */ 541 cchYield ++; 538 542 #else 539 543 DosWrite(1, (void*)&chReturn, 1, &ul); … … 550 554 psz += cch; 551 555 cchMax -= cch; 556 cchYield += cch; 557 if (cchYield > 3) 558 if (Yield()) 559 cchYield = 0; 552 560 } 553 561 return psz; -
trunk/src/win32k/misc/yield.c
r1272 r1535 1 /* $Id: yield.c,v 1. 2 1999-10-14 01:20:34bird Exp $1 /* $Id: yield.c,v 1.3 1999-10-31 23:57:08 bird Exp $ 2 2 * 3 3 * Yield - conversion may take some time. So it is necessary to … … 27 27 * Checks if we have to yield the CPU. Yield it if we must. 28 28 */ 29 voidYield(void)29 BOOL Yield(void) 30 30 { 31 31 PBYTE pfbYield; 32 32 33 33 pfbYield = D32Hlp_GetDOSVar(DHGETDOSV_YIELDFLAG, 0UL); 34 if (pfbYield != NULL && *pfbYield) 35 { 36 D32Hlp_Yield(); 37 return TRUE; 38 } 34 39 35 if (pfbYield != NULL && *pfbYield) 36 D32Hlp_Yield(); 40 return FALSE; 37 41 } -
trunk/src/win32k/pe2lx/pe2lx.cpp
r1467 r1535 1 /* $Id: pe2lx.cpp,v 1. 5 1999-10-27 02:03:01bird Exp $1 /* $Id: pe2lx.cpp,v 1.6 1999-10-31 23:57:09 bird Exp $ 2 2 * 3 3 * Pe2Lx class implementation. Ring 0 and Ring 3 … … 126 126 #include "pe2lx.h" /* Pe2Lx class definitions, ++. */ 127 127 #include <versionos2.h> /* Pe2Lx version. */ 128 #include "yield.h" /* Yield CPU. */ 128 129 129 130 … … 650 651 return rc; 651 652 } 653 Yield(); 652 654 653 655 /* 14.Convert base relocations (fixups). Remember to add the fixup for RegisterPe2LxDll/Exe. */ … … 658 660 return rc; 659 661 } 662 Yield(); 660 663 661 664 /* 15.Make object table. */ … … 674 677 return rc; 675 678 } 679 Yield(); 676 680 677 681 /* 17.Completing the LX header. */ … … 732 736 /* 20.Dump virtual LX-file */ 733 737 dumpVirtualLxFile(); 738 739 Yield(); 734 740 735 741 return NO_ERROR; … … 2157 2163 else /* page++ */ 2158 2164 ulRVAPage += PAGESIZE; 2165 Yield(); 2159 2166 } /* The Loop! */ 2160 2167 … … 2322 2329 if (rc != NO_ERROR) 2323 2330 printErr(("export --> entry loop failed! ul = %d rc = %d\n", ul, rc)); 2331 Yield(); 2324 2332 2325 2333 /* Convert function names to resident names. */ … … 2349 2357 rc = addResName(usOrdinal, psz, ~0UL); 2350 2358 free(psz); 2359 Yield(); 2351 2360 } 2352 2361 if (rc != NO_ERROR)
Note:
See TracChangeset
for help on using the changeset viewer.