Lazarus

Free Pascal => FPC development => Topic started by: Azarien on September 24, 2015, 03:34:29 pm

Title: building i8086_msdos target
Post 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.

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?
Title: Re: building i8086_msdos target
Post by: Jonas Maebe on September 24, 2015, 03:38:39 pm
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.
Title: Re: building i8086_msdos target
Post by: Handoko on September 24, 2015, 04:39:58 pm
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).
Title: Re: building i8086_msdos target
Post by: molly on September 24, 2015, 05:10:10 pm
Quote
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 ?
Title: Re: building i8086_msdos target
Post by: Handoko on September 24, 2015, 05:16:06 pm
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
Title: Re: building i8086_msdos target
Post by: molly on September 24, 2015, 05:28:59 pm
Not very sure, but I think better chances of success if you use i386 in the parameter:

Quote
topic: building i8086_msdos target
Quote
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
Title: Re: building i8086_msdos target
Post by: marcov on September 24, 2015, 06:34:24 pm
Jonas' remarks about smartlinking are probably the problem. Smartlinking is nearly mandatory for i8086.
Title: Re: building i8086_msdos target
Post by: Azarien on September 24, 2015, 07:07:22 pm
Yes, with smartlinking flags everything works.
Thank you.

It seems that even standard units are too big when compiled without smartlinking.
Title: Re: building i8086_msdos target
Post by: marcov on September 24, 2015, 09:21:18 pm
Either that or your memory model is picked too small :-)
Title: Re: building i8086_msdos target
Post by: Azarien on September 24, 2015, 10:29:51 pm
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).
Title: Re: building i8086_msdos target
Post by: Jonas Maebe on September 24, 2015, 10:32:20 pm
go32v2 binaries are only supported under real Dos or under Win9x.
Title: Re: building i8086_msdos target
Post by: Coldfire on December 07, 2015, 07:41:30 pm
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
Title: Re: building i8086_msdos target
Post by: marcov on December 07, 2015, 07:46:09 pm
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.
Title: Re: building i8086_msdos target
Post by: Coldfire on December 07, 2015, 08:17:39 pm
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?
Title: Re: building i8086_msdos target
Post by: Azarien on December 22, 2015, 10:28:51 pm
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)
Title: Re: building i8086_msdos target
Post by: marcov on January 13, 2016, 09:19:09 am
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.


TinyPortal © 2005-2018