From: Dan A. <da...@gm...> - 2004-02-04 22:32:47
|
Good evening, I've successfully managed to build and test linux.sys using the GNU toolchain. I used ReactOS's helper.mk, pointed by Steven Edwards to generated the rather complex command line sequence that achieves this goal (look at the patch below). Thanks for Nir Perry for encouraging me to try this method further than I thought. Next coLinux release can be built on a Linux box entirely, using the GNU toolchain. However, w32api needs to be patched and built from source, because there is a mistake in one of the kernel imports defined there (I'm mailing the author). Would one of you like me to maintain precompiled binaries of a cygwin cross build tools for Linux, as .deb and/or .rpm files, so that the others won't have to mess with setting up this build environment? --- colinux-20040131/src/colinux/os/winnt/build/Makefile 2004-01-31 18:57:08.000000000 +0200 +++ colinux-20040204/src/colinux/os/winnt/build/Makefile 2004-02-05 00:11:27.000000000 +0200 @@ -21,47 +21,30 @@ DRIVER_TARGET := $(BUILD_PATH)/linux.sys -WINDIR=$(WINUSER)@$(WINBOX):$(WINREMOTEDIR) -WINBOX_SCP=scp -i ~/.ssh/locallan -WINBOX_SSH=ssh -X -l $(WINUSER) -i ~/.ssh/locallan $(WINBOX) -WINLINK=$(WINBOX_SSH) /cygdrive/c/NTDDK/bin/link.exe - -WINLINK_FLAGS= \ - /machine:ix86 \ - /STACK:262144,4096 \ - /MERGE:_PAGE=PAGE \ - /MERGE:_TEXT=.text \ - /SECTION:INIT,d \ - /OPT:REF \ - /OPT:ICF \ - /IGNORE:4001,4037,4039,4044,4065,4070,4078,4087,4089,4198 \ - /INCREMENTAL:NO \ - /FULLBUILD \ - /FORCE:MULTIPLE \ - /NOCOMMENT \ - /release \ - /NODEFAULTLIB \ - /debug:FULL \ - /debugtype:cv \ - /version:5.00 \ - /osversion:5.00 \ - /optidata \ - /driver \ - /align:0x1000 \ - /filealign:0x1000 \ - /subsystem:native,5.00 \ - /base:0x10000 \ - /entry:DriverEntry@8 \ - -WINLINK_LIBS= \ - C:\\\\NTDDK\\\\libfre\\\\i386\\\\ntoskrnl.lib \ - C:\\\\NTDDK\\\\libfre\\\\i386\\\\hal.lib \ - C:\\\\NTDDK\\\\libfre\\\\i386\\\\wmilib.lib \ - -$(DRIVER_TARGET): $(BUILD_PATH)/driver.o - $(WINBOX_SCP) $^ $(WINDIR) - $(WINLINK) /out:$(notdir $@) $(WINLINK_FLAGS) $(notdir $^) $(WINLINK_LIBS) - $(WINBOX_SCP) $(WINDIR)$(notdir $@) $@ +CLEAN_FILES += $(BUILD_PATH)/driver.base.tmp +$(BUILD_PATH)/driver.base.tmp: $(BUILD_PATH)/driver.o + i686-pc-cygwin-gcc -Wl,--base-file,$@ \ + -Wl,--entry,_DriverEntry@8 \ + -nostartfiles -nostdlib \ + -o junk.tmp $^ -lntoskrnl -lhal + rm -f junk.tmp + +CLEAN_FILES += $(BUILD_PATH)/driver.base.exp +$(BUILD_PATH)/driver.base.exp: $(BUILD_PATH)/driver.base.tmp + i686-pc-cygwin-dlltool --dllname linux.sys \ + --base-file $^ \ + --output-exp $@ + +$(DRIVER_TARGET): $(BUILD_PATH)/driver.o $(BUILD_PATH)/driver.base.exp + i686-pc-cygwin-gcc \ + -Wl,--subsystem,native \ + -Wl,--image-base,0x10000 \ + -Wl,--file-alignment,0x1000 \ + -Wl,--section-alignment,0x1000 \ + -Wl,--entry,_DriverEntry@8 \ + -Wl,$(word 2,$^) \ + -mdll -nostartfiles -nostdlib \ + -o $@ $(word 1,$^) -lntoskrnl -lhal LOCAL_TARGET += $(DRIVER_TARGET) LOCAL_FILES = \ @@ -74,16 +57,7 @@ colinux: $(LOCAL_FILES) -parts: $(LOCAL_FILES) - -upload: $(LOCAL_FILES) - $(WINBOX_SCP) $^ $(WINDIR) - -upload_console: $(BUILD_ROOT)/colinux/os/current/user/console/colinux-console.exe - $(WINBOX_SCP) $^ $(WINDIR) - driver: $(BUILD_PATH)/driver.o - CLEAN_FILES := $(CLEAN_FILES) \ $(LOCAL_TARGETS) Here's the patch against w32api: --- w32api-2.4/lib/ddk/ntoskrnl.def 2003-02-09 15:26:01.000000000 +0200 +++ w32api-2.4-patched/lib/ddk/ntoskrnl.def 2004-02-04 23:40:02.000000000 +0200 @@ -596,8 +596,8 @@ KeSetTargetProcessorDpc@8 ;KeSetTimeIncrement @KeSetTimeUpdateNotifyRoutine@4 -KeSetTimer@12 -KeSetTimerEx@16 +KeSetTimer@16 +KeSetTimerEx@20 ;KeStackAttachProcess KeSynchronizeExecution@12 ;KeTerminateThread -- Dan Aloni da...@gm... |