flat assembler
Message board for the users of flat assembler.

Index > Main > Can't use int 21h, func 440dh, subfunc 41h in Win98???

Author
Thread Post new topic Reply to topic
Per Norrby



Joined: 13 Mar 2005
Posts: 3
Per Norrby 13 Mar 2005, 17:44
I've written a small back-up program where I use "Int 21h, func 440dh,
minor code 41h" - "Write Track on Logical Drive".
It worked OK in DOS 6 but in Windows 98 SE I've got problems.
Of course I've changed CH to 48h since I use FAT32, and there's no
problem to read tracks from floppys, HDD:s, card readers or whatever
into my image file.
But when I'm trying to write back the tracks to anything but the floppy,
I get the error code "Authorization Problem" via "Get Extended Error".
Apparently Windows demands some permission for me to write on my
own drives!
So - how do I get that permission???
Per Norrby
Post 13 Mar 2005, 17:44
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 13 Mar 2005, 19:33
you can probably use the "lock" command from a command prompt - I don't know how to do this programatically though, but I guess ralf's interrupt list might have the answer.
Post 13 Mar 2005, 19:33
View user's profile Send private message Visit poster's website Reply with quote
Per Norrby



Joined: 13 Mar 2005
Posts: 3
Per Norrby 15 Mar 2005, 05:52
Thanks for your suggestion.
But the only locking I know about is file locking, int 21h func 5ch.
This is something else, it's that Win 98 stopping me from writing
track by track on my HDD:s. Also, I'm not allowed to use Format
Track on Logical Drive!
It has to be a way to resolve these problems, some int or func
or may be some API to ask Win to give me what authority I need.
May be it would work if I went back to FAT16 but that's just to much.
Like I said - in DOS 6 everything works OK.
Regards , Per N.
Post 15 Mar 2005, 05:52
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 15 Mar 2005, 20:18
hello
i used bios function to read write absolute sectors, it worked under w98 and me,
but be aware that you have to restart your machine to reload data ( if you work on c this means a hard reset, otherwise w can corrupt your data. )

ofcourse direct io access is disabled unless you make a driver.
there are some windows functions to daw sector rw no? scandisk, defrag does it too.
Post 15 Mar 2005, 20:18
View user's profile Send private message Visit poster's website Reply with quote
drs



Joined: 20 Jan 2005
Posts: 17
Location: Southern California, USA
drs 16 Mar 2005, 03:58
Sorry for the late response, I know this is not in assembler but this is what I used to read the MBR off Windows 2000/XP machines. It is written in C but shouldn't be to hard to convert. I hope it's acceptable to post here..


Description: Read first 512 bytes of C:
Download
Filename: readmbr.c
Filesize: 2.51 KB
Downloaded: 428 Time(s)

Post 16 Mar 2005, 03:58
View user's profile Send private message ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 16 Mar 2005, 09:26
Doing it with the win32 API is easy (on NT systems, anyway) - the OP wants 16bit code using DOS/BIOS interrupts.
Post 16 Mar 2005, 09:26
View user's profile Send private message Visit poster's website Reply with quote
Per Norrby



Joined: 13 Mar 2005
Posts: 3
Per Norrby 27 Mar 2005, 18:37
Hello f0dder,
I really do owe you an appology!
You instantly adviced me to use the LOCK command to get
the authority to write directly to all my drives. But
then I couldn't think of anything else but MS-DOS 5's
file locking function included in the SHARE command,
so I didn't take your advice very seriously.
Now I've learned that LOCK isn't what I thought it'd be,
and that I should have listened more carefully to you in
the first place.
My only excuse is that I've been off this kind of
programming for some years.
In the future I'll shurely analyze your tips more
seriously!
Regards,
Per N.

Ps
I'd appreciate to have the possibility to address you
personally.
If that's OK with you, you could leave a PM with your
mail address.
Ds
Post 27 Mar 2005, 18:37
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 27 Mar 2005, 18:47
It's OK, I haven't touched DOS for so long that I thought I might be wrong Smile - have you found what interrupt + func to use, or are you relying on calling command.com's LOCK? I'll PM you my mail address.
Post 27 Mar 2005, 18:47
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.