Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
7fe09bce
Commit
7fe09bce
authored
Jun 03, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved kernel initialization to kernel_main.c
parent
2d8cf500
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
123 additions
and
96 deletions
+123
-96
Makefile.in
dlls/kernel/Makefile.in
+3
-0
kernel_main.c
dlls/kernel/kernel_main.c
+91
-0
ttydrv_main.c
dlls/ttydrv/ttydrv_main.c
+3
-0
x11drv_main.c
dlls/x11drv/x11drv_main.c
+3
-0
relay.c
if1632/relay.c
+11
-15
main.c
loader/main.c
+0
-70
process.c
scheduler/process.c
+12
-11
No files found.
dlls/kernel/Makefile.in
View file @
7fe09bce
...
...
@@ -15,6 +15,9 @@ SPEC_SRCS = \
toolhelp.spec
\
wprocs.spec
C_SRCS
=
\
kernel_main.c
@MAKE_DLL_RULES@
### Dependencies:
dlls/kernel/kernel_main.c
0 → 100644
View file @
7fe09bce
/*
* Kernel initialization code
*/
#include <assert.h>
#include "winbase.h"
#include "wine/winbase16.h"
#include "neexe.h"
#include "module.h"
#include "task.h"
#include "comm.h"
#include "selectors.h"
#include "miscemu.h"
#include "global.h"
/***********************************************************************
* KERNEL process initialisation routine
*/
static
BOOL
process_attach
(
void
)
{
HMODULE16
hModule
;
/* Initialize DOS memory */
if
(
!
DOSMEM_Init
(
0
))
return
FALSE
;
if
((
hModule
=
LoadLibrary16
(
"krnl386.exe"
))
<
32
)
return
FALSE
;
/* Initialize special KERNEL entry points */
/* Initialize KERNEL.178 (__WINFLAGS) with the correct flags value */
NE_SetEntryPoint
(
hModule
,
178
,
GetWinFlags16
()
);
/* Initialize KERNEL.454/455 (__FLATCS/__FLATDS) */
NE_SetEntryPoint
(
hModule
,
454
,
__get_cs
()
);
NE_SetEntryPoint
(
hModule
,
455
,
__get_ds
()
);
/* Initialize KERNEL.THHOOK */
TASK_InstallTHHook
((
THHOOK
*
)
PTR_SEG_TO_LIN
((
SEGPTR
)
NE_GetEntryPoint
(
hModule
,
332
)));
/* Initialize the real-mode selector entry points */
#define SET_ENTRY_POINT( num, addr ) \
NE_SetEntryPoint( hModule, (num), GLOBAL_CreateBlock( GMEM_FIXED, \
DOSMEM_MapDosToLinear(addr), 0x10000, hModule, \
FALSE, FALSE, FALSE, NULL ))
SET_ENTRY_POINT
(
183
,
0x00000
);
/* KERNEL.183: __0000H */
SET_ENTRY_POINT
(
174
,
0xa0000
);
/* KERNEL.174: __A000H */
SET_ENTRY_POINT
(
181
,
0xb0000
);
/* KERNEL.181: __B000H */
SET_ENTRY_POINT
(
182
,
0xb8000
);
/* KERNEL.182: __B800H */
SET_ENTRY_POINT
(
195
,
0xc0000
);
/* KERNEL.195: __C000H */
SET_ENTRY_POINT
(
179
,
0xd0000
);
/* KERNEL.179: __D000H */
SET_ENTRY_POINT
(
190
,
0xe0000
);
/* KERNEL.190: __E000H */
NE_SetEntryPoint
(
hModule
,
173
,
DOSMEM_BiosSysSeg
);
/* KERNEL.173: __ROMBIOS */
NE_SetEntryPoint
(
hModule
,
193
,
DOSMEM_BiosDataSeg
);
/* KERNEL.193: __0040H */
NE_SetEntryPoint
(
hModule
,
194
,
DOSMEM_BiosSysSeg
);
/* KERNEL.194: __F000H */
#undef SET_ENTRY_POINT
/* Force loading of some dlls */
if
(
LoadLibrary16
(
"system"
)
<
32
)
return
FALSE
;
if
(
LoadLibrary16
(
"wprocs"
)
<
32
)
return
FALSE
;
/* Initialize communications */
COMM_Init
();
/* Read DOS config.sys */
if
(
!
DOSCONF_ReadConfig
())
return
FALSE
;
return
TRUE
;
}
/***********************************************************************
* KERNEL initialisation routine
*/
BOOL
WINAPI
MAIN_KernelInit
(
HINSTANCE
hinst
,
DWORD
reason
,
LPVOID
reserved
)
{
static
int
process_count
;
switch
(
reason
)
{
case
DLL_PROCESS_ATTACH
:
if
(
!
process_count
++
)
return
process_attach
();
break
;
case
DLL_PROCESS_DETACH
:
--
process_count
;
break
;
}
return
TRUE
;
}
dlls/ttydrv/ttydrv_main.c
View file @
7fe09bce
...
...
@@ -87,6 +87,9 @@ static void process_attach(void)
MONITOR_PrimaryMonitor
.
depth
=
1
;
TTYDRV_GDI_Initialize
();
/* load display.dll */
LoadLibrary16
(
"display"
);
}
...
...
dlls/x11drv/x11drv_main.c
View file @
7fe09bce
...
...
@@ -311,6 +311,9 @@ static void process_attach(void)
/* initialize event handling */
X11DRV_EVENT_Init
();
/* load display.dll */
LoadLibrary16
(
"display"
);
}
...
...
if1632/relay.c
View file @
7fe09bce
...
...
@@ -8,10 +8,10 @@
#include <string.h>
#include "wine/winbase16.h"
#include "winnt.h"
#include "global.h"
#include "heap.h"
#include "module.h"
#include "stackframe.h"
#include "selectors.h"
#include "builtin16.h"
#include "task.h"
#include "syslevel.h"
...
...
@@ -35,29 +35,25 @@ BOOL RELAY_Init(void)
extern
void
CallTo16_Ret
();
extern
void
CALL32_CBClient_Ret
();
extern
void
CALL32_CBClientEx_Ret
();
extern
DWORD
CallTo16_RetAddr
;
extern
DWORD
CALL32_CBClient_RetAddr
;
extern
DWORD
CALL32_CBClientEx_RetAddr
;
codesel
=
GLOBAL_CreateBlock
(
GMEM_FIXED
,
(
void
*
)
Call16_Ret_Start
,
(
int
)
Call16_Ret_End
-
(
int
)
Call16_Ret_Start
,
GetModuleHandle16
(
"KERNEL"
),
TRUE
,
TRUE
,
FALSE
,
NULL
);
extern
SEGPTR
CallTo16_RetAddr
;
extern
SEGPTR
CALL32_CBClient_RetAddr
;
extern
SEGPTR
CALL32_CBClientEx_RetAddr
;
codesel
=
SELECTOR_AllocBlock
(
(
void
*
)
Call16_Ret_Start
,
(
char
*
)
Call16_Ret_End
-
(
char
*
)
Call16_Ret_Start
,
SEGMENT_CODE
,
TRUE
,
FALSE
);
if
(
!
codesel
)
return
FALSE
;
/* Patch the return addresses for CallTo16 routines */
CallTo16_RetAddr
=
MAKELONG
(
(
int
)
CallTo16_Ret
-
(
int
)
Call16_Ret_Start
,
codesel
);
PTR_SEG_OFF_TO_SEGPTR
(
codesel
,
(
char
*
)
CallTo16_Ret
-
(
char
*
)
Call16_Ret_Start
);
CALL32_CBClient_RetAddr
=
MAKELONG
(
(
int
)
CALL32_CBClient_Ret
-
(
int
)
Call16_Ret_Start
,
codesel
);
PTR_SEG_OFF_TO_SEGPTR
(
codesel
,
(
char
*
)
CALL32_CBClient_Ret
-
(
char
*
)
Call16_Ret_Start
);
CALL32_CBClientEx_RetAddr
=
MAKELONG
(
(
int
)
CALL32_CBClientEx_Ret
-
(
int
)
Call16_Ret_Start
,
codesel
);
PTR_SEG_OFF_TO_SEGPTR
(
codesel
,
(
char
*
)
CALL32_CBClientEx_Ret
-
(
char
*
)
Call16_Ret_Start
);
#endif
/* Create built-in modules */
if
(
!
BUILTIN_Init
())
return
FALSE
;
/* Initialize thunking */
return
THUNK_Init
();
}
...
...
loader/main.c
View file @
7fe09bce
...
...
@@ -12,20 +12,13 @@
#include <errno.h>
#include "windef.h"
#include "wine/winbase16.h"
#include "comm.h"
#include "neexe.h"
#include "main.h"
#include "drive.h"
#include "file.h"
#include "miscemu.h"
#include "options.h"
#include "process.h"
#include "global.h"
#include "shell.h"
#include "selectors.h"
#include "task.h"
#include "debugtools.h"
#include "win16drv.h"
#include "server.h"
#include "loadorder.h"
...
...
@@ -64,72 +57,9 @@ BOOL MAIN_MainInit( char *argv[] )
/* Initialize module loadorder */
if
(
!
MODULE_InitLoadOrder
())
return
FALSE
;
return
TRUE
;
}
/***********************************************************************
* KERNEL initialisation routine
*/
BOOL
WINAPI
MAIN_KernelInit
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
{
static
BOOL
initDone
=
FALSE
;
HMODULE16
hModule
;
if
(
initDone
)
return
TRUE
;
initDone
=
TRUE
;
/* Initialize DOS memory */
if
(
!
DOSMEM_Init
(
0
))
return
FALSE
;
if
(
!
LoadLibrary16
(
"KRNL386.EXE"
))
return
FALSE
;
/* Initialize special KERNEL entry points */
hModule
=
GetModuleHandle16
(
"KERNEL"
);
if
(
hModule
)
{
/* Initialize KERNEL.178 (__WINFLAGS) with the correct flags value */
NE_SetEntryPoint
(
hModule
,
178
,
GetWinFlags16
()
);
/* Initialize KERNEL.454/455 (__FLATCS/__FLATDS) */
NE_SetEntryPoint
(
hModule
,
454
,
__get_cs
()
);
NE_SetEntryPoint
(
hModule
,
455
,
__get_ds
()
);
/* Initialize KERNEL.THHOOK */
TASK_InstallTHHook
((
THHOOK
*
)
PTR_SEG_TO_LIN
(
(
SEGPTR
)
NE_GetEntryPoint
(
hModule
,
332
)));
/* Initialize the real-mode selector entry points */
#define SET_ENTRY_POINT( num, addr ) \
NE_SetEntryPoint( hModule, (num), GLOBAL_CreateBlock( GMEM_FIXED, \
DOSMEM_MapDosToLinear(addr), 0x10000, hModule, \
FALSE, FALSE, FALSE, NULL ))
SET_ENTRY_POINT
(
183
,
0x00000
);
/* KERNEL.183: __0000H */
SET_ENTRY_POINT
(
174
,
0xa0000
);
/* KERNEL.174: __A000H */
SET_ENTRY_POINT
(
181
,
0xb0000
);
/* KERNEL.181: __B000H */
SET_ENTRY_POINT
(
182
,
0xb8000
);
/* KERNEL.182: __B800H */
SET_ENTRY_POINT
(
195
,
0xc0000
);
/* KERNEL.195: __C000H */
SET_ENTRY_POINT
(
179
,
0xd0000
);
/* KERNEL.179: __D000H */
SET_ENTRY_POINT
(
190
,
0xe0000
);
/* KERNEL.190: __E000H */
NE_SetEntryPoint
(
hModule
,
173
,
DOSMEM_BiosSysSeg
);
/* KERNEL.173: __ROMBIOS */
NE_SetEntryPoint
(
hModule
,
193
,
DOSMEM_BiosDataSeg
);
/* KERNEL.193: __0040H */
NE_SetEntryPoint
(
hModule
,
194
,
DOSMEM_BiosSysSeg
);
/* KERNEL.194: __F000H */
#undef SET_ENTRY_POINT
}
/* Initialize relay code */
if
(
!
RELAY_Init
())
return
FALSE
;
/* Initialize communications */
COMM_Init
();
/* Initialize IO-port permissions */
IO_port_init
();
/* Read DOS config.sys */
if
(
!
DOSCONF_ReadConfig
())
return
FALSE
;
return
TRUE
;
}
...
...
scheduler/process.c
View file @
7fe09bce
...
...
@@ -243,8 +243,6 @@ static int load_system_dlls(void)
{
char
driver
[
MAX_PATH
];
if
(
!
LoadLibraryA
(
"KERNEL32"
))
return
0
;
PROFILE_GetWineIniString
(
"Wine"
,
"GraphicsDriver"
,
"x11drv"
,
driver
,
sizeof
(
driver
)
);
if
(
!
LoadLibraryA
(
driver
))
{
...
...
@@ -340,6 +338,18 @@ static void start_process(void)
entry
=
(
LPTHREAD_START_ROUTINE
)
RVA_PTR
(
module
,
OptionalHeader
.
AddressOfEntryPoint
);
console_app
=
(
PE_HEADER
(
module
)
->
OptionalHeader
.
Subsystem
==
IMAGE_SUBSYSTEM_WINDOWS_CUI
);
if
(
console_app
)
pdb
->
flags
|=
PDB32_CONSOLE_PROC
;
/* Signal the parent process to continue */
req
->
module
=
(
void
*
)
module
;
req
->
entry
=
entry
;
req
->
gui
=
!
console_app
;
server_call
(
REQ_INIT_PROCESS_DONE
);
debugged
=
req
->
debugged
;
/* Load KERNEL (necessary for TASK_Create) */
if
(
!
LoadLibraryA
(
"KERNEL32"
))
goto
error
;
/* Create 16-bit dummy module */
if
((
hModule16
=
MODULE_CreateDummyModule
(
pdb
->
exe_modref
->
filename
,
module
))
<
32
)
ExitProcess
(
hModule16
);
...
...
@@ -350,15 +360,6 @@ static void start_process(void)
NtCurrentTeb
(),
NULL
,
0
))
goto
error
;
if
(
console_app
)
pdb
->
flags
|=
PDB32_CONSOLE_PROC
;
/* Signal the parent process to continue */
req
->
module
=
(
void
*
)
module
;
req
->
entry
=
entry
;
req
->
gui
=
!
console_app
;
server_call
(
REQ_INIT_PROCESS_DONE
);
debugged
=
req
->
debugged
;
/* Load the system dlls */
if
(
!
load_system_dlls
())
goto
error
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment