Recent

Author Topic: [SOLVED] Racking my brain for a hello world compile for MSDOS  (Read 770 times)

chobani

  • New Member
  • *
  • Posts: 15
[SOLVED] Racking my brain for a hello world compile for MSDOS
« on: November 09, 2022, 02:22:41 am »
Is there any step by step example to compile MSDOS target from WIN32/64? I installed the cross compiler for FPC, it's in the correct directory that lazarus is targeting for FPC. When I try and select that as a target I get "The current FPC has not config file." Okay, I see that all over when I search google, but I never seem to get a direct answer for windows on what and where I'm supposed to do.

I'd really appreciate it if someone could do a RTFM point to some exact steps. I just want to get to the point where I can do a simple writeln('Hello world!'); to MSDOS. I can see it's working for other people and I can only get to the point of installing the cross compiler to my FPC directory. Much appreciated!
« Last Edit: November 28, 2022, 03:58:04 pm by chobani »

PascalDragon

  • Hero Member
  • *****
  • Posts: 4880
  • Compiler Developer
Re: Racking my brain for a hello world compile for MSDOS
« Reply #1 on: November 09, 2022, 07:27:23 am »
So, just to be clear, in the same directory as the fpc.exe that Lazarus' configuration points to, there is your native compiler (ppc386.exe or ppcx64.exe) as well as the i8086 cross compiler (ppcross8086.exe)? In the settings of your project you selected i8086 as processor and MSDOS as operating system?

chobani

  • New Member
  • *
  • Posts: 15
Re: Racking my brain for a hello world compile for MSDOS
« Reply #2 on: November 09, 2022, 03:57:04 pm »
Ahhhh okay, thank you. So no it's not in the same directory because I am using 64 so my bin directory looks like i386-win32 (cross compiler is there) and x86_64-win64 where my main compiler is. So I guess my options are installing win32 FPC or finding x86_64 version? I checked and didn't see any other windows options, but I might be looking in the wrong area.  Thanks so much for the reply!

chobani

  • New Member
  • *
  • Posts: 15
Re: Racking my brain for a hello world compile for MSDOS
« Reply #3 on: November 09, 2022, 09:11:50 pm »
So I copied the files in the same dir and tried to run from command line. I've seen others run into this too, but can't seem to find specific steps to resolve.

Free Pascal Compiler version 3.2.2 [2021/05/19] for i8086
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: MS-DOS 16-bit real mode
Compiling helloworld.lpr
Fatal: Can't find unit system used by helloworld
Fatal: Compilation aborted
Error: C:\lazarus\fpc\3.2.2\bin\x86_64-win64\ppcross8086.exe returned an error exitcode

So I guess if I could just have some guidance on maybe the fpc.cfg I'm guessing base on other posts?  Thanks again!

PascalDragon

  • Hero Member
  • *****
  • Posts: 4880
  • Compiler Developer
Re: Racking my brain for a hello world compile for MSDOS
« Reply #4 on: November 10, 2022, 07:26:17 am »
So I guess if I could just have some guidance on maybe the fpc.cfg I'm guessing base on other posts?  Thanks again!

Please check the paths inside your fpc.cfg which should be located in the x86_64-win64 directory. There should be various entries like the following (adjusted to your own location obviously):

Code: [Select]
# Search for $fpctarget/$fpcsubarch-$fpcmemorymodel/ subdirectory first
# for i8086 CPU
#ifdef cpui8086
-FuC:\lazarus\2.2\fpc\$FPCVERSION/units/$fpctarget/$fpcsubarch-$fpcmemorymodel
-FuC:\lazarus\2.2\fpc\$FPCVERSION/units/$fpctarget/$fpcsubarch-$fpcmemorymodel/*
-FuC:\lazarus\2.2\fpc\$FPCVERSION/units/$fpctarget/$fpcsubarch-$fpcmemorymodel/rtl
#endif

Please note that in case of MSDOS the value for $fpctarget will be msdos and not i8086-msdos.

So I copied the files in the same dir and tried to run from command line. I've seen others run into this too, but can't seem to find specific steps to resolve.

You can also pass -vut to the compiler to see where it tries to search for its units (and the configuration file) to see whether everything matches with what is expected.

chobani

  • New Member
  • *
  • Posts: 15
Re: Racking my brain for a hello world compile for MSDOS
« Reply #5 on: November 10, 2022, 04:04:00 pm »
Yep, I'm an idiot. It was looking at the wrong one. Thank you, I was banging my head on that one. I just need one more step though, I can't still compile from inside Lazarus. I was able to compile to MSDOS from command line and run that compiled program from DOS! But I am getting this from within the IDE -

Error: Util wlink.exe not found, switching to external linking

I did a search and found this which is exactly where I'm at now: https://forum.lazarus.freepascal.org/index.php?topic=54825.0

However, I don't see this option in any of the settings. Is it possible to get me past this final hurdle?  Much appreciated!


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10492
  • FPC developer.
Re: Racking my brain for a hello world compile for MSDOS
« Reply #6 on: November 10, 2022, 04:26:44 pm »
That link gives an answer? Disable debugging options for the dos project in lazarus IDE.

chobani

  • New Member
  • *
  • Posts: 15
Re: Racking my brain for a hello world compile for MSDOS
« Reply #7 on: November 10, 2022, 04:28:05 pm »
Sure does friend. That setting is clearly right there in project options -> compiler options -> debugging. I doubt anyone will miss that but just in case.

Thanks for everything, apologies for the dumb questions. I'm off to do some MSDOS compiles!

 

TinyPortal © 2005-2018