Adding 64-bit file support to DJGPP

Adding 64-bit file support to DJGPP

Post by 048321887- » Thu, 19 Jan 2006 14:00:52


Hi!

I would like to know how difficult it would be to add support for
64-bit file operations to DJGPP. I suppose that DJGPP currently only
handles 32-bit file operations internally; is this assumption correct?
If yes, it would be necessary to extend the internal file handling
routines of DJGPP to 64 bit before any attempt to add support for new
APIs could be made.

Is anyone currently working on this, or has been working on this
before? If yes, I would be interested in his assessment. If not, what
would be a good starting point?

Regards,

Udo
 
 
 

Adding 64-bit file support to DJGPP

Post by DJ Delori » Thu, 19 Jan 2006 14:22:12


DJGPP relies on MS-DOS's file api, and MS-DOS doesn't support 64 bit
operations.

 
 
 

Adding 64-bit file support to DJGPP

Post by 048321887- » Thu, 19 Jan 2006 14:41:56


The LFN API in MS-DOS 7.0 and higher already uses 64-bit file
operations in some functions, e.g. 714E/4Fh of Int 21h. Also, DOS is
still evolving, so newer DOS versions provide functions that old
versions lack.

For example, this is the new 64-bit LSEEK function of Enhanced DR-DOS,
which will also eventually be supported by FreeDOS:

--------O-2142-------------------------------
INT 21 - EDR-DOS 7.01.08+ - "Long LSEEK" - SET CURRENT 64-bit FILE
POSITION
AX = 7142h
CL = origin of move
00h start of file
01h current file position
02h end of file
BX = file handle
DS:DX = pointer to (signed) 64-bit offset from origin of new position
Return: CF clear if successful
DS:DX unchanged, new 64-bit position from start of file at ->
DS:DX
CF set on error
AX = error code (01h,06h) (see #01680 at AH=59h/BX=0000h)

For the moment, I would like to put the question of API support in the
OSes aside and concentrate on the implementation of 64-bit file support
in DJGPP itself.

Udo
 
 
 

Adding 64-bit file support to DJGPP

Post by Charles Sa » Thu, 19 Jan 2006 17:11:25

> The LFN API in MS-DOS 7.0 and higher already uses 64-bit file

The unreleased, in limbo development tree v2.04 in cvs contains some
support for the larger file offsets. You could investigate and
contribute support.


A review of what's been done already would be a good starting point.
 
 
 

Adding 64-bit file support to DJGPP

Post by Rod Pember » Thu, 19 Jan 2006 18:43:32


<snip>

For personal use, I compiled a very raw but complete list of every interrupt
called by every function for an older version of DJGPP. DJGPP version 3.4.1
calls about 170 DOS, BIOS, etc. interrupts. I'll just list the ones that
call 71xx functions below my signature. If you need to know which ones call
specific functions, just ask in this newsgroup or the other newsgroup you
post DR-DOS announcements too. Have you contacted Henrik Haftmann or Jason
Hood about 64-bit support in DOSLFN?


Rod Pemberton


71xx calls for DJGPP 3.4.1:

remove 713a 7141
_rename 7156
findfirst 714e 71a1
findnext 714f 71a1
_truename 7160
_chmode 7143
_flush_disk_cache 710d
_open 7160 7143 716c
_creat 716c
_creatnew 716c
_get_volume_info 71a0
_lfn_gen_short_fname 7100 71a8
direct_exec_tail_1 7160
_lfn_find_close 71a1
get_sft_entry 71a6
__get_current_directory 7147 7160
mkdir 7139
rmdir 713a
symlink 7160
__getcwd 7147 7160
__chdir 713b
utime 7143
 
 
 

Adding 64-bit file support to DJGPP

Post by Maurice.Lo » Thu, 19 Jan 2006 21:06:54


Rod Pemberton a rit:

What is this version number ? just curious...

Maurice

--
Maurice Lombardi
Laboratoire de Spectrometrie Physique,
Universite Joseph Fourier de Grenoble, BP87
38402 Saint Martin d'Heres Cedex FRANCE
Tel: 33 (0)4 76 51 47 51
Fax: 33 (0)4 76 63 54 95
mailto: XXXX@XXXXX.COM
 
 
 

Adding 64-bit file support to DJGPP

Post by DJ Delori » Fri, 20 Jan 2006 00:56:54


I don't know. I'm still working on djgpp version 2.04.
 
 
 

Adding 64-bit file support to DJGPP

Post by Rod Pember » Fri, 20 Jan 2006 03:37:52


interrupt
3.4.1

Sorry, that's the version for GCC. Ah, so I guess it is a list for the
current version of DJGPP. :)

DJDEV & DJLSR v203
(w/GCC & GPP v341)
(w/GLIB v126)
(w/BNU v215)

RP
 
 
 

Adding 64-bit file support to DJGPP

Post by Rod Pember » Fri, 20 Jan 2006 03:57:52


interrupt
3.4.1

I'm curious. Will v2.04 use the standard GNU C library or is that out of
the question?


Rod
 
 
 

Adding 64-bit file support to DJGPP

Post by DJ Delori » Fri, 20 Jan 2006 04:02:00


That's out of the question.
 
 
 

Adding 64-bit file support to DJGPP

Post by Rod Pember » Fri, 20 Jan 2006 04:57:59


of

Ah, well, I figured it'd be much easier to maintain DJGPP if it used the GNU
C library. I think it'd also be a step towards 64-bit support and perhaps
even IBM's Cell cpu.

What exactly is the the issue? That the DOS and Linux API's don't match?
That there needs to be a POSIX layer?


Rod Pemberton
 
 
 

Adding 64-bit file support to DJGPP

Post by DJ Delori » Fri, 20 Jan 2006 05:06:26


Yes, all of that. A large chunk of the DJGPP C library deals with
letting your application pretend that MS-DOS is really a POSIX.1
system, and hiding all the *** details.

Plus, there's a lot of stuff in glibc that just isn't going to work
under MS-DOS. It really wants to be Linux-only.

In short, it's just a bad idea.
 
 
 

Adding 64-bit file support to DJGPP

Post by Rod Pember » Fri, 20 Jan 2006 06:18:16


Wow! I find it really interesting that with all the POSIX code you wrote,
and the code for POSIX-on-DOS w/DPMI of the CMU MACH DOS, that a simple
POSIX on DOS 32-bit OS couldn't be written...

I'm currently working on a personal on-top-of DOS Ring 0 OS written almost
entirely in C which (hey, there are CISC instructions...) :
1) compiles with DJGPP, and OW1.3, small amount of NASM
2) from RM, dumps the DJGPP DPMI host or the OW DPMI host/dos-extender and
returns to PM ring 0 32-bit 4Gb base 0
3) setups a new GDT and IDT
4) reprograms PICs
5) setup IRQs (rough, but there, C stack frame getting in the way for some
functions :( )
6) implements ISRs (proto routines for 0x31,0x21,0x33,0x16)
7) (in progress) initializes keyboard and mouse routines (working on the
buffers/queue)

I'm hoping to finish the keyboard and mouse routines soon so I can move on
to floppy/hard disk. I'll also need to get to the PITs sometime... With
time, it could possibly exec all DJGPP or OW programs in an exclusively
32-bit environment... Multitasking should be possible for DJGPP
applications due to the segment memory model. However, OW uses a single 4Gb
segment. I'm not sure if I can get multi-tasking working for it. I was
suprised at just how closely a large portion of my DPMI dumper code matches
the requirements for a GRUB bootloader...


Rod Pemberton
 
 
 

Adding 64-bit file support to DJGPP

Post by DJ Delori » Fri, 20 Jan 2006 06:33:31


Of course it can be written. It just wouldn't be DJGPP.

Taken to extremes, you've re-invented Linux ;-)
 
 
 

Adding 64-bit file support to DJGPP

Post by Johann 'My » Fri, 20 Jan 2006 07:02:23

DJ Delorie < XXXX@XXXXX.COM > writes:


And with an addition of a lisp engine, he'll re-invent emacs ;)


Johann

--
johann myrkraverk com (you know the drill with the @ and .)
I classify Outlook mail as spam, use something else.