Lazarus
Free Pascal => FPC development => Topic started by: Azarien on September 24, 2015, 03:34:29 pm
-
I'm trying to build a cross-compiler from win32 to dos.
I'm using the latest SVN sources.
c:\svn\fpc>make OS_TARGET=msdos CPU_TARGET=i8086 all
but it ends with:
sstrings.inc(2124,10) Fatal: Code segment too large
Fatal: Compilation aborted
What should I do? Is this target not buildable at the moment?
-
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.
-
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
What 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).
-
I'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 ?
-
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
-
Not very sure, but I think better chances of success if you use i386 in the parameter:
topic: building i8086_msdos target
I'm trying to build a cross-compiler from win32 to dos
If 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
-
Jonas' remarks about smartlinking are probably the problem. Smartlinking is nearly mandatory for i8086.
-
Yes, with smartlinking flags everything works.
Thank you.
It seems that even standard units are too big when compiled without smartlinking.
-
Either that or your memory model is picked too small :-)
-
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).
-
go32v2 binaries are only supported under real Dos or under Win9x.
-
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).
how you compiled Go32v2->MSDOS? i can't fin that target in the IDE
-
how 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.
-
how 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?
-
What 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.
how 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)
-
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.