Hi, Samuel Thibault, le Tue 19 Sep 2006 15:03:47 +0200, a écrit : > I put a (really) rough patch on > http://dept-info.labri.fr/~thibault/tmp/patch-yasm
I updated this patch. It should apply fine to debian's current yasm. With it I was able to recompile my good old .COM programs, quite neat :) The attached patch is the loadlin modifications that are currently needed: there are 4 macros which will probably difficult to handle, but they effect can be easily be performed by hand. The "size" operator will probably be difficult to implement, since yasm has no notion of the size and type of a label. But as the patch shows, it is easy to replace them. What remains is making the omf output work correctly (with org directives), and the structure stuff. Yes, I consider implementing structures anyway. Patching loadlin would be quite tedious, it will be needed on the long run anyway, and I already have collected the clues on how to do it, so... I hope to do this relatively sharply. Samuel
diff -ur loadlin-1.6c.really1.6c/debian/changelog loadlin-1.6c.really1.6c-mine/debian/changelog --- loadlin-1.6c.really1.6c/debian/changelog 2006-10-08 16:07:43.000000000 +0200 +++ loadlin-1.6c.really1.6c-mine/debian/changelog 2006-05-03 02:53:09.000000000 +0200 @@ -1,3 +1,9 @@ +loadlin (1.6c.really1.6c-1yasm) unstable; urgency=low + + * Build loadlin.exe with yasm. (closes: #356055) + + -- Samuel Thibault <[EMAIL PROTECTED]> Mon, 8 Aug 2005 12:20:59 +0200 + loadlin (1.6c.really1.6c-1) unstable; urgency=low * New upstream version: 1.6c; really for this time diff -ur loadlin-1.6c.really1.6c/debian/control loadlin-1.6c.really1.6c-mine/debian/control --- loadlin-1.6c.really1.6c/debian/control 2006-10-08 16:07:43.000000000 +0200 +++ loadlin-1.6c.really1.6c-mine/debian/control 2006-05-03 02:53:09.000000000 +0200 @@ -2,6 +2,7 @@ Section: admin Priority: optional Maintainer: LENART Janos <[EMAIL PROTECTED]> +Build-Depends: hexdump yasm Standards-Version: 3.6.2.1 Package: loadlin Seulement dans loadlin-1.6c.really1.6c-mine/debian: patch-srclinux diff -ur loadlin-1.6c.really1.6c/debian/rules loadlin-1.6c.really1.6c-mine/debian/rules --- loadlin-1.6c.really1.6c/debian/rules 2006-10-08 16:07:43.000000000 +0200 +++ loadlin-1.6c.really1.6c-mine/debian/rules 2006-10-08 23:31:06.000000000 +0200 @@ -15,7 +15,13 @@ package=loadlin -build: +loadlin.exe: + tar -x -z -C src/ -f src/srclinux.tgz + patch -p0 < debian/patch-srclinux + make -C src/srclinux + tasm src/loadlin.asm loadlin.exe + +build: loadlin.exe $(checkdir) tar xvfz initrd.tgz cd initrd && $(CC) -O2 -fomit-frame-pointer freeramdisk.c -o freeramdisk @@ -23,6 +29,8 @@ clean: $(checkdir) + -rm -rf src/srclinux + -rm loadlin.exe -rm loadlin.exe.gz -rm -f build -rm -rf initrd Seulement dans loadlin-1.6c.really1.6c-mine/src: core diff -ur loadlin-1.6c.really1.6c/src/loadlin.asm loadlin-1.6c.really1.6c-mine/src/loadlin.asm --- loadlin-1.6c.really1.6c/src/loadlin.asm 2006-10-08 16:09:24.000000000 +0200 +++ loadlin-1.6c.really1.6c-mine/src/loadlin.asm 2006-10-08 21:14:39.000000000 +0200 @@ -607,31 +607,35 @@ push_ macro r1,r2,r3,r4,r5,r6,r7,r8,rx - irp parm,<&r1,&r2,&r3,&r4,&r5,&r6,&r7,&r8,&rx> - ifndef parm - exitm - endif - push parm - endm + XXX + ; irp parm,<&r1,&r2,&r3,&r4,&r5,&r6,&r7,&r8,&rx> + ; ifndef parm + ; exitm + ; endif + ; push parm + ; endm endm pop_ macro r1,r2,r3,r4,r5,r6,r7,r8 - irp parm,<&r8,&r7,&r6,&r5,&r4,&r3,&r2,&r1> - ifdef parm - pop parm - endif - endm + XXX + ; irp parm,<&r8,&r7,&r6,&r5,&r4,&r3,&r2,&r1> + ; ifdef parm + ; pop parm + ; endif + ; endm endm pushAD_struc macro prefix - irp parm,<edi,esi,ebp,esp,ebx,edx,ecx,eax> - prefix&&parm dd ? - endm + XXX + ; irp parm,<edi,esi,ebp,esp,ebx,edx,ecx,eax> + ; prefix&&parm dd ? + ; endm endm pushA_struc macro prefix - irp parm,<di,si,bp,sp,bx,dx,cx,ax> - prefix&&parm dw ? - endm + XXX + ; irp parm,<di,si,bp,sp,bx,dx,cx,ax> + ; prefix&&parm dw ? + ; endm endm diff -ur loadlin-1.6c.really1.6c/src/loadlini.asm loadlin-1.6c.really1.6c-mine/src/loadlini.asm --- loadlin-1.6c.really1.6c/src/loadlini.asm 1996-04-28 22:17:28.000000000 +0200 +++ loadlin-1.6c.really1.6c-mine/src/loadlini.asm 2006-10-08 19:44:38.000000000 +0200 @@ -407,7 +407,8 @@ jz @@not_found @@loop_entry: push di - mov cx,size aux_token + ;mov cx,size aux_token + mov cx,80 call name_compare jz @@loop pop ax ; clean up stack diff -ur loadlin-1.6c.really1.6c/src/loadlinj.asm loadlin-1.6c.really1.6c-mine/src/loadlinj.asm --- loadlin-1.6c.really1.6c/src/loadlinj.asm 2005-08-08 12:19:06.000000000 +0200 +++ loadlin-1.6c.really1.6c-mine/src/loadlinj.asm 2006-10-08 23:32:42.000000000 +0200 @@ -84,7 +84,7 @@ get_VCPI_interface proc near push cs ;* buffer for server GDT entries - push offset gdtvcpi_code ;* + push dword ptr offset gdtvcpi_code ;* push cs ;* buffer for server page0 push offset page0 ;* call get_protected_mode_interface @@ -154,7 +154,7 @@ pop di pop si pop bp - ret returnpop + ret 8 get_protected_mode_interface endp @@ -166,7 +166,8 @@ jc @@ex_false mov bx,ax mov ax,4402h - mov cx,size intv_buf + ;mov cx,size intv_buf + mov cx,128*4 lea dx,intv_buf DosInt pushf @@ -392,7 +393,7 @@ ; we now reset the intvector to bios-defaults push cs pop ds - cmp cx,(size intv_buf)/4 ; have we REALBIOS + cmp cx,128*4/4 ; have we REALBIOS jna @@1 ; no ; yes ; restoring BIOSdata also @@ -401,14 +402,14 @@ lea si,intv_buf cld rep movsd - cmp cs:intv_size,(size intv_buf) ; have we REALBIOS + cmp cs:intv_size,128*4 ; have we REALBIOS jna @@8 ; no ; yes, restoring BIOSscratch also mov di,09FC0h mov es,di xor di,di lea si,bios_scratch - mov cx,(size bios_scratch)/4 + mov cx,1024/4 rep movsd ; now reprogram the PICs (8259A) ; (may be redirected by VCPI-client) @@ -814,7 +815,7 @@ cmp intv_size,0 jz @@3_1_ lea dx,@@t6 - cmp intv_size,(size intv_buf) ; have we REALBIOS + cmp intv_size,128*4 ; have we REALBIOS jna @@3_ lea dx,@@t6_ @@3_: