[fpc-pascal] Compiling for DOS

Lee, John john.lee at logicacmg.com
Sat Nov 12 19:17:24 CET 2005

Felipe, I use Win ME to make go32v2, v2.0.3 and v2.1.1 so this should work ok. I've also used win9se in the past.  

I produce daily snapshots of these. See ftp.freepascal.org\ snapshots\v20 & v21, so you can download these & try them out.

Regards John    

> -----Original Message-----
> From: fpc-pascal-bounces at lists.freepascal.org
> [mailto:fpc-pascal-bounces at lists.freepascal.org]On Behalf Of 
> Tomas Hajny
> Sent: 12 November 2005 18:19
> To: FPC-Pascal users discussions
> Subject: Re: [fpc-pascal] Compiling for DOS
> Date sent:      	Sat, 12 Nov 2005 08:01:30 -0200
> From:           	Felipe Monteiro de Carvalho 
> <felipemonteiro.carvalho at gmail.com>
> To:             	XHajT03 at vol.cz,
> 	FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
> Subject:        	Re: [fpc-pascal] Compiling for DOS
> Hi Felipe,
> > > Your best choice probably is GO32v2. However, as for any other
> > > target, you need RTL compiled for the given target, the 
> appropriate
> > > binutils (as and ld) and the right configuration.
> > 
> > Was FPC compiler able to create real-mode programs in the past? It
> > would be very important for my use, a very precise osciloscope.
> No, FPC was being created as a protected-mode compiler from the very 
> beginning.
> > Can I still use interrupts and IN / OUT assembler opcodes 
> in protected
> > mode?
> Yes, you can, although especially interrupts might be somewhat more 
> complicated (depending on what you need to achieve).
> For ports, you can use in/out instructions and the special array 
> port[] as supported by TP/BP (requires adding unit ports to uses 
> clause).
> Regarding interrupts, there are (at least) two things to be aware of. 
> First, there is one interrupt vector table for the protected mode and 
> another table for the real mode. Calling "int xx" in your protected 
> mode program calls the protected mode interrupt. This will work if 
> interrupt handler for the protected mode version is installed - e.g. 
> protected mode version of interrupt 21h, i.e. DOS services, is 
> probably installed for most DPMI servers as far as I remember 
> correctly, but the same doesn't have to be true for other interrupts. 
> Calling the real mode version is possibly e.g. using GO32.RealIntr 
> (or SysRealIntr).
> Second, working with pointers/memory addresses is little bit more 
> difficult. If you need to pass a memory block to some interrupt (e.g. 
> a buffer to be filled with some information by the interrupt), you 
> need to allocate this memory block within the first MB of your 
> address space (real-mode code cannot access/address more), and you 
> have to remember that this memory block is addressed different way 
> while under real-mode (16-bit segment and offset must be passed to 
> real-mode code) and when accessing it from protected-mode (32-bit 
> flat address is used). Functions Global_Dos_Alloc and Global_Dos_Free 
> provided in unit Go32 are your friends here.
> > > If you can compile
> > > on a Win 9x/ME machine (or even machine with plain DOS), 
> the easiest
> > > solution (not requiring you to play with configuration, 
> proper setup
> > > of directories, etc.) is to download the old 1.0.10 version
> > 
> > Thanks, I'll try that.
> > 
> > > Hopefully a DOS (GO32v2) version of FPC 2.x gets released with one
> > > of the next releases.
> > 
> > Maybe I can help get it released. What is missing? Code or just
> > someone that compiles the whole thing? I have access to a 
> machine with
> > IBM DOS.
> Machine is not such a big problem (although our makefiles don't work 
> under plain DOS, but require some LFN-capable system - it isn't a 
> problem of the compiler, that one works under plain DOS without 
> problems). There have been some bugs which prevented us from having 
> version 2.0.0 released for GO32v2 target too. The most important 
> issues should be hopefully fixed now, but some smaller ones still 
> remain. Anybody able to help with debugging the remaining issues is 
> certainly welcome. ;-)
> Tomas
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.

More information about the fpc-pascal mailing list