building i8086_msdos target lazarus / 64-FPC development ---------------------------------------------------------------------- Azarien · 2015-09-24 13:34 I'm trying to build a cross-compiler from win32 to dos. I'm using the latest SVN sources. Code: [Select]c:\svn\fpc>make OS_TARGET=msdos CPU_TARGET=i8086 all but it ends with: Code: [Select]sstrings.inc(2124,10) Fatal: Code segment too large Fatal: Compilation aborted What should I do? Is this target not buildable at the moment? ---------------------------------------------------------------------- Jonas Maebe · 2015-09-24 13:38 Try following the instructions at http://wiki.freepascal.org/DOS#Building_a_snapshot_manually My guess is that your problem is related to not enabling the generation of dead stripable ("smart linkable") code. ---------------------------------------------------------------------- Handoko · 2015-09-24 14:39 Intel 8086 processor has very limited of accessible memory address. It is 16-bit wide data bus, which means it can only access address up to 2^16 = 64 KB. But by using the help of segment registers, it can access up to 2^20 = 1 MB. I knew it for sure, because I ever created program using Assembly language on 8088 (variant of 8086). I had to limit the maximum program and data size in the 64 KB boundary.  Source: https://en.wikipedia.org/wiki/Intel_8086 Quote from: Azarien on September 24, 2015, 03:34:29 pmWhat should I do? Is this target not buildable at the moment? I'm afraid you have to reduce the size down to at < 1 MB, which I think is (almost) not possible. I wonder why you want to target 8086 processors. It is 25 years old technology. Better try the 32-bit processor (i386), which has more accessible memory (up to 2 GB). ---------------------------------------------------------------------- molly · 2015-09-24 15:10 QuoteI'm afraid you have to reduce the size down to at < 1 MB, which I think is (almost) not possible.I might have understood OT wrong, but isn't that why OT tries to create a cross-compiler ? ---------------------------------------------------------------------- Handoko · 2015-09-24 15:16 Not very sure, but I think better chances of success if you use i386 in the parameter: CPU_TARGET=i386 Even MS DOS 6.22 (1994) can't run on 8086. The minimum requirement of MS DOS 6.22 is Intel 80286 (accessible memory up to 16 MB). Source: http://www.vogons.org/viewtopic.php?t=34315 ---------------------------------------------------------------------- molly · 2015-09-24 15:28 Quote from: Handoko on September 24, 2015, 05:16:06 pmNot very sure, but I think better chances of success if you use i386 in the parameter: Quotetopic: building i8086_msdos targetQuoteI'm trying to build a cross-compiler from win32 to dosIf OT is really sure about the topic then his/her only option is to create cross-compiler, as indeed the memory is to low to run fpc from that. Your suggestion will not provide him with a 8086 cross-compiler, but a 'normal' 32-bit dos compiler. Perhaps it has escaped your attention, but 8086 is a valid target from trunk nowadays, see also link provided by Jonas Maebe ---------------------------------------------------------------------- marcov · 2015-09-24 16:34 Jonas' remarks about smartlinking are probably the problem. Smartlinking is nearly mandatory for i8086. ---------------------------------------------------------------------- Azarien · 2015-09-24 17:07 Yes, with smartlinking flags everything works. Thank you. It seems that even standard units are too big when compiled without smartlinking. ---------------------------------------------------------------------- marcov · 2015-09-24 19:21 Either that or your memory model is picked too small :-) ---------------------------------------------------------------------- Azarien · 2015-09-24 20:29 All memory models are now working (well, at least on a "hello, world" level). I've also compiled a go32v2->msdos cross-compiler. Compilation crashed on Windows 7 with "out of memory", but succeeded on XP virtual machine (it took a looong time but worked). ---------------------------------------------------------------------- Jonas Maebe · 2015-09-24 20:32 go32v2 binaries are only supported under real Dos or under Win9x. ---------------------------------------------------------------------- Coldfire · 2015-12-07 18:41 Quote from: Azarien on September 24, 2015, 10:29:51 pmAll memory models are now working (well, at least on a "hello, world" level). I've also compiled a go32v2->msdos cross-compiler. Compilation crashed on Windows 7 with "out of memory", but succeeded on XP virtual machine (it took a looong time but worked). how you compiled Go32v2->MSDOS? i can't fin that target in the IDE ---------------------------------------------------------------------- marcov · 2015-12-07 18:46 Quote from: Coldfire on December 07, 2015, 07:41:30 pmhow you compiled Go32v2->MSDOS? i can't fin that target in the IDE What Jonas meant is that *any* go32v2 binary is only supported for win9x and real dos. If you use a NT based Windows (NT,2000,XP,2k3,Vista and up) use the win32 compiler. ---------------------------------------------------------------------- Coldfire · 2015-12-07 19:17 Quote from: marcov on December 07, 2015, 07:46:09 pmQuote from: Coldfire on December 07, 2015, 07:41:30 pmhow you compiled Go32v2->MSDOS? i can't fin that target in the IDE What Jonas meant is that *any* go32v2 binary is only supported for win9x and real dos. If you use a NT based Windows (NT,2000,XP,2k3,Vista and up) use the win32 compiler. ahhhhm ok. are there plans to add a i8086 target for the Go32v2 version? ---------------------------------------------------------------------- Azarien · 2015-12-22 21:28 Quote from: marcov on December 07, 2015, 07:46:09 pmWhat Jonas meant is that *any* go32v2 binary is only supported for win9x and real dos. I don't have any problems with go32v2 on XP. Quote from: Coldfire on December 07, 2015, 07:41:30 pmhow you compiled Go32v2->MSDOS? i can't fin that target in the IDE In the console, using ppcross8086.exe (both Win32 and go32v2 versions work) ---------------------------------------------------------------------- marcov · 2016-01-13 08:19 Azarien: but not supported.   XP can run win32, so there is no need to run go32v2 under it. Anyway, maybe a go32v2->i8086 comes with the next major version, when the internal linker currently in trunk comes to fruition, but that is probably years off. You might start experimenting with trunk though.