flat assembler
Message board for the users of flat assembler.

Index > Windows > Still Drivers..

Author
Thread Post new topic Reply to topic
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
Hi, I have some questions about device driver programming.
1) Can device drivers call user-mode API calls ? Like MessageBox, ExitProcess, etc..
2) Device drivers should be programmed in 16 bit assembly ? Because of I guess kernel-mode things are written in 16 bit mode..
3) What I have to learn first before programming device drivers ?
and the last, can somebody show me example of MessageBox API which driver does ? I'm trying to find anything useful in google but I really don't understand a lot from there.. Thanks.
Post 03 Jul 2011, 11:45
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1412
Location: Toronto, Canada
AsmGuru62
Regarding 2): I am sure that drivers are coded in 32-bit Assembly or in C.
Post 03 Jul 2011, 11:58
View user's profile Send private message Send e-mail Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
1. No, However you can signal User mode apps to do that.
2. Not necessarily, they just happen to have all the privileges to execute just about any instruction.
3. Just learn C (so you can port the code to ASM as you wish), and make sure you read the API,.)
Refer to answer #1

WDK 7 Info | http://msdn.microsoft.com/en-us/windows/hardware/gg487463

I have made a driver myself that filters program execution.
Post 03 Jul 2011, 15:06
View user's profile Send private message Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
typedef
I'll learn C now..
1 more question, I saw examples of drivers and there's something strange import data section, which is importing manually.. There don't work something like this ?
Code:
section '.idata' import data readable
library bla bla..
import bla bla..,function,'...'    

Thanks.
edit:
Also, I wrote little prog which dumps MBR (easiest one..) and I'm interested how should I use drivers with user-mode calls ? like, \\.\DeviceXX or something like that..
Sorry, I know I'm really "noob" about these things..
Post 03 Jul 2011, 16:30
View user's profile Send private message Reply with quote
ctl3d32



Joined: 30 Dec 2009
Posts: 204
Location: Brazil
ctl3d32
Post 03 Jul 2011, 20:02
View user's profile Send private message Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
ctl3d32
VxD is still useful on Windows XP+ systems ?
Also, I tried that tutorials but I don't really understand MASN syntax.. It's HLL which I don't understand Sad (Sounds strange but I understand Low-Level language more than HL..)
Post 03 Jul 2011, 20:45
View user's profile Send private message Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
I'm going REALLY mad now! I can't find anywhere how to use IN and OUT instructions.. Can someone suggest me some books about it ? I know what they does, but I don't understand for example why this turns speakers on ?...
Code:
cli
mov al,178 ;or something, I don't remember
out 43h,al
mov eax,blabla
out 42h,al
mov al,ah
out 42h,al
in al,61h ;this turns speaker on I guess!
or al,11b
out 61h,al
sti
.....    

but why ?! I can't find any documentation why these things are happening like this! Can anyone help me ?))
Post 04 Jul 2011, 11:39
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
VxD is purely Win9x.
KMDs for NT are regular PEs, just not running in the Win32 subsystem. Later Win9x even has some (very limited!) KMD support.

For IN/OUT (and memory mapped I/O), you'll need to get datasheets for the hardware you want to write drivers for. Good luck with that, except for very old legacy hardware. Your best bet would be looking at how existing drivers for other operating systems work.
Post 04 Jul 2011, 14:54
View user's profile Send private message Visit poster's website Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
Should I learn OS Developing first before I write drivers ? and also, if exists somewhere, can you give me just a little tutorials about I/O ? Smile Thank you.
Post 04 Jul 2011, 17:26
View user's profile Send private message 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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.