diff --git a/contrib/media/updf/Makefile b/contrib/media/updf/Makefile index 89e591ad2..7b2e4502f 100644 --- a/contrib/media/updf/Makefile +++ b/contrib/media/updf/Makefile @@ -8,8 +8,8 @@ GEN := generated # --- Variables, Commands, etc... --- default: all -LDFLAGS = -T/home/a/svn/kolios/programs/develop/libraries/menuetlibc/include/scripts/menuetos_app_v01.ld -nostdlib -L /home/a/svn/kolios/programs/develop/libraries/menuetlibc/include/lib -melf_i386 -CFLAGS += -Ifitz -Ipdf -Ixps -Iscripts -fno-stack-protector -nostdinc -fno-builtin -m32 -I/home/a/svn/kolios/programs/develop/libraries/menuetlibc/include -fno-pic +LDFLAGS = -T./include/scripts/menuetos_app_v01.ld -nostdlib -L ./include/lib -melf_i386 +CFLAGS += -Ifitz -Ipdf -Ixps -Iscripts -fno-stack-protector -nostdinc -fno-builtin -m32 -I./include -fno-pic LIBS += -lfreetype2 -lpng -ljbig2dec -ljpeg -lopenjpeg -lz -lm -lc #include Makerules @@ -31,7 +31,7 @@ endif CC_CMD = $(QUIET_CC) $(CC) $(CFLAGS) -o $@ -c $< AR_CMD = $(QUIET_AR) $(AR) cru $@ $^ -LINK_CMD = $(QUIET_LINK) ld $(LDFLAGS) -o $@ /home/a/svn/kolios/programs/develop/libraries/menuetlibc/stub/crt0.o $^ build/debug/snprintf.o $(LIBS) +LINK_CMD = $(QUIET_LINK) ld $(LDFLAGS) -o $@ ./stub/crt0.o $^ build/debug/snprintf.o $(LIBS) MKDIR_CMD = $(QUIET_MKDIR) mkdir -p $@ # --- Rules --- diff --git a/contrib/media/updf/include/lib/libopenjpeg.a b/contrib/media/updf/include/lib/libopenjpeg.a new file mode 100644 index 000000000..1e0eff249 Binary files /dev/null and b/contrib/media/updf/include/lib/libopenjpeg.a differ diff --git a/contrib/media/updf/stub/Makefile b/contrib/media/updf/stub/Makefile new file mode 100644 index 000000000..ecf336123 --- /dev/null +++ b/contrib/media/updf/stub/Makefile @@ -0,0 +1,18 @@ +include $(MENUETDEV)/osrules.mak + +.SUFFIXES: .asm; + +OBJS = crt0.o + +all: $(OBJS) + +ifdef ON_WINDOWS +crt0.o: crt0_$(STUBFMT).asm + fasm crt0_$(STUBFMT).asm crt0.o +else +crt0.o: crt0_$(STUBFMT)_nounderscores.asm + fasm crt0_$(STUBFMT)_nounderscores.asm crt0.o +endif + +clean: + $(RM) $(OBJS) diff --git a/contrib/media/updf/stub/crt0.asm b/contrib/media/updf/stub/crt0.asm new file mode 100644 index 000000000..bb9ca001a Binary files /dev/null and b/contrib/media/updf/stub/crt0.asm differ diff --git a/contrib/media/updf/stub/crt0.o b/contrib/media/updf/stub/crt0.o new file mode 100644 index 000000000..7d5f39cb5 Binary files /dev/null and b/contrib/media/updf/stub/crt0.o differ diff --git a/contrib/media/updf/stub/crt0_coff.asm b/contrib/media/updf/stub/crt0_coff.asm new file mode 100644 index 000000000..96e27de1d --- /dev/null +++ b/contrib/media/updf/stub/crt0_coff.asm @@ -0,0 +1,58 @@ +CATCH_NULL_CALL = 0 + +format MS COFF +section '.text' code readable executable +public start +;EXTRN _edata +EXTRN ___menuet__app_param_area +EXTRN ___menuet__app_path_area +EXTRN ___crt1_startup +start: +public ___menuet__app_header +public ___menuet__memsize +section '.A' code readable executable +___menuet__app_header: + db 'MENUET01' + dd 0x01 +if CATCH_NULL_CALL + dd do_start +else + dd ___crt1_startup +end if +; dd _edata + dd 0 +___menuet__memsize: + dd 0x400000 + dd app_stack + dd ___menuet__app_param_area + dd ___menuet__app_path_area + +if CATCH_NULL_CALL +do_start: + mov byte [0], 0xE9 + mov dword [1], _libc_null_call-5 + call ___crt1_startup +; Handle exit if __crt1_startup returns (shouldn't happen) + mov eax,-1 + int 0x40 +end if + +if CATCH_NULL_CALL +EXTRN ___libc_null_call + +_libc_null_call: + push eax + push ebx + push ecx + push edx + push esi + push edi + push ebp + call ___libc_null_call + mov eax,-1 + int 0x40 +end if + +section '.bss' readable writeable +rd 0x20000 +app_stack: diff --git a/contrib/media/updf/stub/crt0_elf.asm b/contrib/media/updf/stub/crt0_elf.asm new file mode 100644 index 000000000..3c012f09d --- /dev/null +++ b/contrib/media/updf/stub/crt0_elf.asm @@ -0,0 +1,56 @@ +CATCH_NULL_CALL = 0 + +format ELF +section '.text' executable +public start +EXTRN _edata +EXTRN ___menuet__app_param_area +EXTRN ___menuet__app_path_area +EXTRN ___crt1_startup +start: +public ___menuet__app_header +public ___menuet__memsize +___menuet__app_header: + db 'MENUET01' + dd 0x01 +if CATCH_NULL_CALL + dd do_start +else + dd ___crt1_startup +end if + dd _edata +___menuet__memsize: + dd 0x800000 + dd app_stack + dd ___menuet__app_param_area + dd ___menuet__app_path_area + +if CATCH_NULL_CALL +do_start: + mov byte [0], 0xE9 + mov dword [1], _libc_null_call-5 + call ___crt1_startup +; Handle exit if __crt1_startup returns (shouldn't happen) + mov eax,-1 + int 0x40 +end if + +if CATCH_NULL_CALL +EXTRN ___libc_null_call + +_libc_null_call: + push eax + push ebx + push ecx + push edx + push esi + push edi + push ebp + call ___libc_null_call + mov eax,-1 + int 0x40 +end if + +section '.bss' writeable +rd 0x20000 +app_stack: diff --git a/contrib/media/updf/stub/crt0_elf_nounderscores.asm b/contrib/media/updf/stub/crt0_elf_nounderscores.asm new file mode 100644 index 000000000..6e369f266 --- /dev/null +++ b/contrib/media/updf/stub/crt0_elf_nounderscores.asm @@ -0,0 +1,56 @@ +CATCH_NULL_CALL = 0 + +format ELF +section '.text' executable +public start +EXTRN edata +EXTRN __menuet__app_param_area +EXTRN __menuet__app_path_area +EXTRN __crt1_startup +start: +public __menuet__app_header +public __menuet__memsize +__menuet__app_header: + db 'MENUET01' + dd 0x01 +if CATCH_NULL_CALL + dd do_start +else + dd __crt1_startup +end if + dd edata +__menuet__memsize: + dd 0x800000 + dd app_stack + dd __menuet__app_param_area + dd __menuet__app_path_area + +if CATCH_NULL_CALL +do_start: + mov byte [0], 0xE9 + mov dword [1], _libc_null_call-5 + call __crt1_startup +; Handle exit if __crt1_startup returns (shouldn't happen) + mov eax,-1 + int 0x40 +end if + +if CATCH_NULL_CALL +EXTRN __libc_null_call + +_libc_null_call: + push eax + push ebx + push ecx + push edx + push esi + push edi + push ebp + call __libc_null_call + mov eax,-1 + int 0x40 +end if + +section '.bss' writeable +rd 4096*4 +app_stack: diff --git a/data/it/Makefile b/data/it/Makefile index a10320996..4c331076b 100644 --- a/data/it/Makefile +++ b/data/it/Makefile @@ -713,5 +713,7 @@ $(REPOSITORY)/drivers/ddk/libcore.a: \ #Rules for updf UPDFDIR=$(REPOSITORY)/contrib/media/updf updf: - $(MAKE) CC=win32-gcc45 AS=win32-as LD=win32-ld AR=win32-ar FASM=fasm -C $(REPOSITORY)/programs/develop/libraries/menuetlibc - $(MAKE) -C $(REPOSITORY)/contrib/menuetlibc + $(MAKE) CC=win32-gcc45 AS=win32-as LD=win32-ld AR=win32-ar FASM=fasm -C $(REPOSITORY)/contrib/media/updf + +clean: + rm -rf 3d build develop 'File Managers' media demos drivers lib network asciivju calendar calc cpu desktop colrdial config.inc cpuid cropflat disptest @docky docky docpack end gmon hdd_info @icon kbd kernel.mnt kpack launcher loaddrv macros.inc madmouse magnify Makefile.skins @menu mgb mousemul mykey @panel pcidev rdsave refrscrn rtfread run scrshoot searchap setup @ss struct.inc terminal test tinypad zkey \ No newline at end of file