Mail Archives: djgpp/2011/03/15/03:45:36
On Mar 14, 11:48=A0pm, Eli Zaretskii <e DOT DOT DOT AT gnu DOT org> wrote:
> > From: Jim Michaels <jmich DOT DOT DOT AT yahoo DOT com>
> > Newsgroups: comp.os.msdos.djgpp
> > Date: Mon, 14 Mar 2011 16:38:41 -0700 (PDT)
>
> > I tried this, and I got 0 for a structure size back.
>
> You mean in your ret_size_of_returned_structure member? =A0Or somewhere
> else?
>
> Did you check the Carry flag after __dpmi_int returns? =A0If the CF is
> set, it means the interrupt failed, and the AX register will contain
> the error code. =A0Did you check that?
>
>
>
> > #if defined(__DJGPP__)
> > #define HANDLE_PRAGMA_PACK_PUSH_POP 1
> > #pragma pack(push,1)
>
> > typedef struct extFAT32FreeSpaceStructure {
> > /* 00h =A0 =A0 WORD*/uint16_t =A0ret_size_of_returned_structure;
> > /* 02h =A0 =A0 WORD*/uint16_t =A0call_structure_version_ret_actual_stru=
cture_version;// (0000h)
> > /* 04h =A0 =A0 DWORD*/uint32_t number_of_sectors_per_cluster_with_adjus=
tment_for_compression;
> > /* 08h =A0 =A0 DWORD*/uint32_t number_of_bytes_per_sector;
> > /* 0Ch =A0 =A0 DWORD*/uint32_t number_of_available_clusters;
> > /* 10h =A0 =A0 DWORD*/uint32_t total_number_of_clusters_on_the_drive;
> > /* 14h =A0 =A0 DWORD*/uint32_t number_of_physical_sectors_available_on_=
the_drive_without_adjustment_for_compression;
> > /* 18h =A0 =A0 DWORD*/uint32_t total_number_of_physical_sectors_on_the_=
drive_without_adjustment_for_compression;
> > /* 1Ch =A0 =A0 DWORD*/uint32_t number_of_available_allocation_units_wit=
hout_adjustment_for_compression;
> > /* 20h =A0 =A0 DWORD*/uint32_t total_allocation_units_without_adjustmen=
t_for_compression;
> > /* 24h =A08 BYTEs*/uint64_t =A0reserved;
> > uint32_t wastedspace;
> > } extFAT32FreeSpaceStructure;
>
> > #pragma pack(pop)
>
> > #endif
>
> > #define STR_OFS 0x30
> > #define STRUCT_OFS 0x0
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 unsigned long adr=3Dr.x.es;
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 adr<<=3D4;
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 adr +=3D r.x.di;
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dosmemget(__tb+STRUCT_OFS+adr, =
sizeof(extFAT32FreeSpaceStructure), pds);
>
> What is `pds' here? =A0Please show complete code, not fragments that
> omit crucial details.
>
> And why do you include the `wastedspace' member in the struct? =A0It is
> not part of the structure, according to RBIL.
>
> Also, what does `sizeof(extFAT32FreeSpaceStructure)' return? =A0It
> should be 32; if not, you should look for a bug.
>
> Anyway, your use of dosmemget is incorrect. =A0According to the
> dosmemget documentation, ES:DI is not an offset into the transfer
> buffer, it's the real-time SEG:OFF address itself. =A0So you should do
> this:
>
> =A0 dosmemget(adr, sizeof(extFAT32FreeSpaceStructure), pds);
>
> (assuming `pds' is correct, and you remove `wastedspace' from the
> structure, because it makes you fetch data beyond what DOS fills in).
>
> Or you could use __tb+STRUCT_OFS instead of `adr', because my reading
> of RBIL is that DOS fills the buffer whose address you passed to it in
> ES:DI when you called __dpmi_int. =A0Per the FAQ, you should have put
> the segment and offset of __tb in ES:DI before invoking __dpmi_int, so
> the buffer filled by DOS is in the transfer buffer, and __tb is its
> address.
doesn't work. I already check the carry flag, which If I am not
mistaken is r.x.flags & 1. I am not a total idiot. every compiler
wants things its own way (openwatcom is different).
the reason why I padded the struct to size 0x30 was because some of
the djgpp dos memory access functions require accessing memory in 16-
byte chunks (0x10), or segment size chunks.
I still get garbage whatever I try.
I think I may have to take this problem to the freedos folks and see
why 7303h doesn't seem to work on their OS when they are supposed to
support it.
I am still learning. but I need to get solid code so I can say to the
freedos folk, "your OS is broken, here's how", or, I can have a
working program that works on freedos which uses FAT32 and maybe
windows 98.
I am going to see what they say about this in the freedos forum. they
got some kind of pc world code to work in freedos and give FAT32
results.
- Raw text -