Adding epoc target. Tried to define our own entry point but it fails at runtime trying to load msvcr80d.dll. Try using /NODEFAULTLIB for all targets maybe. Must somehow export ekern.dll for it to be loadable by epoc.exe. anywhere
authorSlion
Thu, 07 Jan 2010 01:23:42 +0100
branchanywhere
changeset 25 57330c35d3d7
parent 24 18d195b75193
child 26 01da090338f9
Adding epoc target. Tried to define our own entry point but it fails at runtime trying to load msvcr80d.dll. Try using /NODEFAULTLIB for all targets maybe. Must somehow export ekern.dll for it to be loadable by epoc.exe.
kernel/eka/CMakeLists.txt
kernel/eka/euser/CMakeLists.txt
kernel/eka/euser/epoc/win32/uc_epoc.cpp
kernel/eka/euser/epoc/win32/uc_utl.cpp
kernel/eka/kernel/CMakeLists.txt
--- a/kernel/eka/CMakeLists.txt	Wed Jan 06 20:35:57 2010 +0100
+++ b/kernel/eka/CMakeLists.txt	Thu Jan 07 01:23:42 2010 +0100
@@ -32,7 +32,7 @@
 #Custom target that will generate our exec headers 
 add_custom_target(genexec DEPENDS ./include/exec_enum.h ./include/exec_user.h ./include/kernel/exec_kernel.h)
 
-add_subdirectory(./euser ./euser/bin)
-add_subdirectory(./kernel ./kernel/bin)
+add_subdirectory(./euser)
+add_subdirectory(./kernel)
 
 
--- a/kernel/eka/euser/CMakeLists.txt	Wed Jan 06 20:35:57 2010 +0100
+++ b/kernel/eka/euser/CMakeLists.txt	Thu Jan 07 01:23:42 2010 +0100
@@ -109,8 +109,21 @@
 add_library (euser SHARED ${source})
 add_dependencies(euser genexec emulator)
 
-add_library (estub ../euser/epoc/win32/uc_stub.cpp)
+add_library (estub STATIC ../euser/epoc/win32/uc_stub.cpp)
+#set_target_properties(estub PROPERTIES LINK_FLAGS /ENTRY:E32Bootstrap)
 
+add_executable(epoc ../euser/epoc/win32/uc_epoc.cpp)
+add_dependencies(epoc estub euser)
+set_target_properties(epoc PROPERTIES LINK_FLAGS "/ENTRY:mainCRTStartup /SUBSYSTEM:WINDOWS")
+#set_target_properties(epoc PROPERTIES LINK_FLAGS "/ENTRY:_E32Bootstrap /SUBSYSTEM:WINDOWS /NODEFAULTLIB /NOASSEMBLY")
+ #set_target_properties(target1 target2 ... PROPERTIES prop1 value1 prop2 value2 ...)
+
+
+#No need for emulator here
+#add_executable(epoc ./euser/epoc/win32/uc_epoc.cpp)
+#target_link_libraries(epoc estub euser)
+ 
+ 
 #define vs IDE folders
 source_group(Sources REGULAR_EXPRESSION ".+\\.cpp$")
 source_group(Includes REGULAR_EXPRESSION ".+\\.h$") 	
--- a/kernel/eka/euser/epoc/win32/uc_epoc.cpp	Wed Jan 06 20:35:57 2010 +0100
+++ b/kernel/eka/euser/epoc/win32/uc_epoc.cpp	Thu Jan 07 01:23:42 2010 +0100
@@ -14,3 +14,34 @@
 // e32\euser\epoc\win32\uc_epoc.cpp
 // 
 //
+#include <e32std.h>
+#include <e32std_private.h>
+#include <e32wins.h>
+
+
+//SL: this file is empty on FCL
+
+/*
+extern "C"
+GLDEF_C TInt _E32Startup()
+//
+// Unused in the stub
+//
+	{
+	return KErrNone;
+	}
+
+GLDEF_C void __stdcall _E32Bootstrap()
+//
+// stub for bootstrapping EPOC
+//
+	{
+	BootEpoc(EFalse);
+	}
+*/
+
+
+int main(int argc, char* argv[])
+	{
+	BootEpoc(EFalse);
+	}
--- a/kernel/eka/euser/epoc/win32/uc_utl.cpp	Wed Jan 06 20:35:57 2010 +0100
+++ b/kernel/eka/euser/epoc/win32/uc_utl.cpp	Thu Jan 07 01:23:42 2010 +0100
@@ -98,7 +98,9 @@
    
 EXPORT_C void BootEpoc(TBool aAutoRun)
 	{
-	HINSTANCE epoc = LoadLibraryA("ekern.exe");
+	//SL:
+	HINSTANCE epoc = LoadLibraryA("ekern.dll");
+	//HINSTANCE epoc = LoadLibraryA("ekern.exe");
 	if (epoc)
 		{
 		TBootEpoc ep = (TBootEpoc)GetProcAddress(epoc, "_E32Startup");
--- a/kernel/eka/kernel/CMakeLists.txt	Wed Jan 06 20:35:57 2010 +0100
+++ b/kernel/eka/kernel/CMakeLists.txt	Thu Jan 07 01:23:42 2010 +0100
@@ -120,17 +120,6 @@
 add_library(ekern SHARED ${source})
 add_dependencies(ekern genexec emulator)
 				
-#library					
-#include "../memmodel/memmodel.mmp"
-
-
-#macro					
-
-
-#No need for emulator here
-#add_executable(epoc ./euser/epoc/win32/uc_epoc.cpp)
-#target_link_libraries(epoc estub euser)
-