Commit Graph

84 Commits

Author SHA1 Message Date
nickysn
4f573b50ad * access the Default8087CW global variable directly from within inline asm,
instead of copying it to a local var first, since the concern about PIC code
  (this asm code started out as a copy of the i386 rtl code) doesn't exist on
  the i8086, since there's no such thing as PIC code on the i8086

git-svn-id: trunk@41311 -
2019-02-12 16:31:16 +00:00
nickysn
62fe6cb5d3 + integrated the port access via Port[] in the i8086-msdos system unit to ease
porting TP7 code. The ports unit also remains for compatibility with code that
  has already been ported to FPC.

git-svn-id: trunk@39422 -
2018-07-09 15:40:12 +00:00
florian
c63c3e99c7 * load environment on msdos if parameters are loaded, so paramstr(0) is loaded as well
git-svn-id: trunk@38205 -
2018-02-11 17:49:17 +00:00
Károly Balogh
444d032607 msdos: enable FPC_STDOUT_TRUE_ALIAS by default
git-svn-id: trunk@38197 -
2018-02-10 22:46:48 +00:00
pierre
ba7586a5c8 Fix for FPU generated exception as interrupt 0x10, contributed by Max Nazhalov
git-svn-id: trunk@36813 -
2017-07-29 11:50:21 +00:00
pierre
963d109331 Add two word variables to store fpu control and status register in interrupt 0x10
git-svn-id: trunk@36653 -
2017-07-05 22:03:27 +00:00
pierre
adfd578659 Correct error in commit 36437: restore interrupt must be $10, not $06
git-svn-id: trunk@36497 -
2017-06-13 21:02:10 +00:00
pierre
d68ebf7cfb Disable specific coprocessor int 0x10 handler if possible
git-svn-id: trunk@36488 -
2017-06-12 06:52:35 +00:00
pierre
e06f1f89ef Solve bug report 31919, by avoiding SEG reloaction in tiny model
git-svn-id: trunk@36437 -
2017-06-06 12:01:39 +00:00
pierre
e092f00843 Avoid trying to use invalid instruction exception if Test8087 is below 2, as older CPU ignore simply invalid instructions
git-svn-id: trunk@36298 -
2017-05-22 20:41:36 +00:00
pierre
50e5256f8e * system.pp:
+ Add MSDOS specific version of SysInitFPU, using Get/SetInterrput Vectors
    to test coprocessor presence.
    * Do not call SetupEnvironment in startup code.
    + Add internal_envp variable (nil by default).
    + Change envp to function, which calls SetUpEnvironment,
    if internal_envp is nil.
    * Do not call SetupArguments at startup,
    instead call it from inside paramcount or paramstr
    + Add SaveInt10 and SavdeInt75

  * dos.pp: Also swap Interrupt vectors $10 and $75

  * sysutils.pp: Adapt to envp change in system unit.

git-svn-id: trunk@36268 -
2017-05-19 22:01:12 +00:00
pierre
579b8dafd2 Do not call initunicodestringmanager if unicodestrings feature is disabled
git-svn-id: trunk@36110 -
2017-05-05 08:01:45 +00:00
pierre
7d0d41be4b Allow msdos RTL compilation with -Sfnodynlibs
git-svn-id: trunk@36108 -
2017-05-04 22:54:53 +00:00
nickysn
e0267e3088 + call InitSystemThreads in the msdos system unit startup, to initialize the
thread manager object, so that rtl calls to InitCriticalSection don't crash

git-svn-id: trunk@34681 -
2016-10-08 22:03:27 +00:00
pierre
a72434e93a Trial to clarify heap for i8086 issues:
- MSDOS heap in tinyheap.inc modified to use usual
  SysGetMem and similar names.
  - Use HAS_MEMORYMANAGER (used previously in wince source code,
  to specify that a memory manager is defined elsewhere than inside
  heap.inc include file.
  - Use
  - Remove TinyHeapMemoryManager Structure variable completely

  heaptrc.pp: remove unneeded macro code after name changes of tinyheap.inc

  msdos/system.pp now only defines HAS_MEMORYMANAGER macro
  win16/system.pp defines HAS_MEMORYMANAGER and FPC_NO_DEFAULT_HEAP
  as it still uses a different memory manager.
  __stkbottom variable added for win16 system.pp as it is required
  by i8086 specific stack check code.

git-svn-id: trunk@33983 -
2016-06-13 22:26:03 +00:00
pierre
2a3b5bec86 Add new FPC_NO_DEFAULT_MEMORYMANAGER define for msdos OS
git-svn-id: trunk@33675 -
2016-05-11 14:27:26 +00:00
pierre
3bf9019676 + Define FPC_ANSI_TEXTFILEREC to avoid unnecessary use of unicode char
+ Add possibility to disable FEATURE_WIDESTRINGS by
 setting conditional NO_WIDESTRINGS
 + Add ifndef RTLLITE around LFN code

git-svn-id: trunk@32948 -
2016-01-16 00:42:36 +00:00
nickysn
20e5b3e586 * handle empty environment correctly when initializing argv0 under msdos.
Patch by Max Nazhalov, mantis #28705.

git-svn-id: trunk@32028 -
2015-10-12 17:59:51 +00:00
nickysn
ace95e550b * initialize argc and argv on i8086-msdos. This fixes paramcount and paramstr
in objfpc mode on this platform (mantis #28705)
+ support quoted parameters like the go32v2 target

git-svn-id: trunk@32018 -
2015-10-11 17:38:45 +00:00
nickysn
4454332d7a * fixed the sysutils.GetEnvironment* functions for i8086-msdos
- removed the envp variable from the msdos system unit, because it's not
  compatible with ppchar in all memory models (we use ppfarchar to avoid copying
  the environment in the program's data segment in near data memory models)

git-svn-id: trunk@32017 -
2015-10-11 13:23:59 +00:00
Tomas Hajny
db7a9950d1 * unit name changed to System (starting with uppercase 'S') for improved compatibility to Delphi - see test tobject5.pp
git-svn-id: trunk@30025 -
2015-02-27 19:00:50 +00:00
sergei
3a5e6485b5 - RTL: removed InitVariantManager, it was an empty procedure since day 1.
git-svn-id: trunk@29114 -
2014-11-22 20:35:46 +00:00
nickysn
8edfd33af8 * use RegisterTinyHeapBlock_Simple_Prealigned in the msdos rtl
git-svn-id: trunk@28652 -
2014-09-13 19:55:55 +00:00
nickysn
c8e9d2cf6e + added a simplified version of RegisterTinyHeapBlock, for use when the tiny
heap is a single memory block

git-svn-id: trunk@28635 -
2014-09-09 12:45:47 +00:00
nickysn
9979aa702f + added the TP7-compatible pointer variables HeapOrg and HeapEnd, indicating,
respectively, the start and end of the tiny heap. Eventually they are also
  going to be used for catching attempts to free memory that is outside the
  heap.

git-svn-id: trunk@28437 -
2014-08-17 22:42:44 +00:00
nickysn
b1144508a7 * fixed the far/huge data ifdefs in InitDosHeap
git-svn-id: trunk@28348 -
2014-08-08 21:44:19 +00:00
nickysn
ace28a3552 * InitNearHeap procedure renamed InitDosHeap and added support for a huge heap.
Startup code still needs to be updated in order to enable >64kb heap.

git-svn-id: trunk@28334 -
2014-08-07 22:00:24 +00:00
nickysn
23b0cf2340 * msdos system unit variable dos_psp renamed PrefixSeg for TP7 compatibility
git-svn-id: trunk@28047 -
2014-06-24 10:58:59 +00:00
nickysn
1295b4abf7 - removed the call to CheckNullArea from the exit code for the tiny memory model
git-svn-id: trunk@28006 -
2014-06-19 21:47:46 +00:00
nickysn
626000e50d + added System.SelectorInc to the msdos rtl (BP7 compatibility)
git-svn-id: trunk@27497 -
2014-04-07 08:26:53 +00:00
nickysn
34e8e5a0dc * handle zero length strings correctly in DebugWrite/DebugWriteLn
git-svn-id: trunk@27459 -
2014-04-03 21:47:42 +00:00
nickysn
381d09d03f + added extra_data_offset constant, similar to extra_param_offset but for data
pointer size fixups

git-svn-id: trunk@27356 -
2014-03-29 21:43:09 +00:00
nickysn
4a649c9b08 + i8086 far data memory model support in DebugWrite
git-svn-id: trunk@27265 -
2014-03-24 16:51:38 +00:00
nickysn
32c3f4e682 + added cld to DebugWrite
git-svn-id: trunk@27264 -
2014-03-24 15:41:29 +00:00
nickysn
517f802ccc * revert to the initial implementation of GetCommandLine as the code generator
bug mentioned in the comment has been fixed

git-svn-id: trunk@27173 -
2014-03-17 20:33:32 +00:00
nickysn
41d28f91e5 - rm asmmode intel from the i8086-msdos rtl, as that is the default asm mode on
that platform

git-svn-id: trunk@27144 -
2014-03-15 13:01:05 +00:00
nickysn
2425eb243a * DebugWrite and DebugWriteLn moved to the implementation part of the system
unit. No need to expose them anymore, as the regular Write/WriteLn have been
  quite stable on i8086-msdos for a long time now.

git-svn-id: trunk@27143 -
2014-03-15 12:31:01 +00:00
sergei
3a55c4301e * Since StackTop=StackBottom+StackLength, any two variables are sufficient to describe stack, the third one is redundant.
* As a first part of cleanup, replaced StackTop with function returning StackBottom+StackLength.
* On Win32 and Win64, StackTop returns the stack base from TIB instead.

git-svn-id: trunk@27119 -
2014-03-12 19:48:03 +00:00
nickysn
90c04fef80 + added nil pointer assignment test at the end of program for i8086-msdos
(works only for small and medium memory model)

git-svn-id: trunk@26888 -
2014-02-26 19:28:57 +00:00
nickysn
180ddf2ddd + i8086 FPU detection code updated to also identify the FPU type (8087/287/387+)
and initialize the Test8087 global variable.

git-svn-id: trunk@26200 -
2013-12-08 20:50:52 +00:00
nickysn
06c5acf69a + added division by zero exception handling for i8086-msdos
git-svn-id: trunk@26073 -
2013-11-12 22:05:05 +00:00
nickysn
8066d12c87 * fixed the stack traces under i8086-msdos (StackTop wasn't initialized)
git-svn-id: trunk@25863 -
2013-10-27 13:53:16 +00:00
nickysn
28c16f31e6 * __stkbottom, __nearheap_start and __nearheap_end moved to the implementation
part of the system unit for i8086-msdos

git-svn-id: trunk@25862 -
2013-10-27 13:28:58 +00:00
nickysn
009037f9d9 * the Seg0040, SegA000, SegB000 and SegB800 constants changed to typed constants
for Borland Pascal 7 compatibility. This allows doing e.g. 'mov es, [SegA000]'
  in inline asm, which is BP7 compatible, but would produce a wrong result
  if SegA000 was an untyped constant.

git-svn-id: trunk@25674 -
2013-10-06 09:07:55 +00:00
nickysn
5d4ebf0dca + added extra_param_offset constant for accessing parameters in asm routines with nostackframe
git-svn-id: trunk@24873 -
2013-06-11 21:08:43 +00:00
nickysn
4e2962e6ae - do not initialize the regular heap manager under i8086-msdos, so it can be smartlinked away
git-svn-id: trunk@24614 -
2013-05-25 19:22:31 +00:00
nickysn
0013186e2d + fully implemented ParamStr and ParamCount on i8086-msdos
git-svn-id: trunk@24582 -
2013-05-24 18:20:08 +00:00
nickysn
035cb74855 * far pointer helper types made global in the implementation of the system unit
git-svn-id: trunk@24578 -
2013-05-24 17:28:53 +00:00
nickysn
de26059b61 + added dos version check in GetProgramName
git-svn-id: trunk@24576 -
2013-05-24 15:45:16 +00:00
nickysn
9185ee9423 - rm debug writeln committed by accident
git-svn-id: trunk@24575 -
2013-05-24 15:43:34 +00:00