flat assembler
Message board for the users of flat assembler.

Index > Windows > FASM Driver: "Hello World"

Author
Thread Post new topic Reply to topic
NEASM



Joined: 13 Apr 2018
Posts: 13
NEASM 13 May 2018, 13:05
Guys,

i have a question about Windows drivers. I wanted to ask you, is there a way to create a Hello World driver for Windows in ".sys" format? I can not find satisfactory examples. Thanks in advance.
Post 13 May 2018, 13:05
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20454
Location: In your JS exploiting you and your system
revolution 13 May 2018, 13:39
It depends upon your Windows version. Later versions of Windows don't allow drivers to interact with the user desktop.

If you don't get your driver signed then you will also need to put your PC into driver debug mode to load it. To sign it you have to register and pay MS some money.
Post 13 May 2018, 13:39
View user's profile Send private message Visit poster's website Reply with quote
CFasm



Joined: 04 Dec 2015
Posts: 4
CFasm 10 Sep 2018, 04:17
yes,fasm can compile sys
Post 10 Sep 2018, 04:17
View user's profile Send private message Reply with quote
Ben321



Joined: 07 Dec 2017
Posts: 70
Ben321 01 Oct 2018, 05:49
revolution wrote:
It depends upon your Windows version. Later versions of Windows don't allow drivers to interact with the user desktop.

If you don't get your driver signed then you will also need to put your PC into driver debug mode to load it. To sign it you have to register and pay MS some money.


Good point. Older versions of Windows (especially like 98, ME, and 2000) don't force you to sign your driver (which costs money). I think XP and newer do require a signed driver but it can be self signed for testing (and the newest Win versions are even more difficult to even TEST YOUR OWN drivers on, because running the driver with a test certificate requires putting the computer itself into a low-security mode using the PC's firmware settings in either the BIOS or EFI).

If you want to experiment with driver programming, your best bet is use Windows 2000 or older, which doesn't enforce any driver signing.

In fact, I'd be interested in doing that myself, if somebody could provide a link to a "hello world" driver assembly-language tutorial.
Post 01 Oct 2018, 05:49
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 01 Oct 2018, 07:31
There are some old (2006) examples of 64-bit drivers written by Feryno (František Gábriš) on the bottom of the ancient Examples page. For (even older) 32-bit samples you could look on the board.
Post 01 Oct 2018, 07:31
View user's profile Send private message Visit poster's website Reply with quote
Ben321



Joined: 07 Dec 2017
Posts: 70
Ben321 01 Oct 2018, 18:31
So if I compile a Windows SYS file for a legacy driver, how does one install the driver? I know with PnP device drivers (not the kind of driver I want to make), it requires the hardware to be plugged in for the driver to be installed and run, as well as an installation procedure which requires the registry to be edited. With legacy (non PnP) device drivers though I think the driver automatically runs at boot up (no registry edits required) and then remains in memory, as long as it's placed in the System32 folder. Is this correct?

But how does one install it, other than putting the SYS file in the System32 folder? Is there, or is there not, any special step(s) to install it? For example do I need to add an entry for the driver it to the registry or win.ini?
Post 01 Oct 2018, 18:31
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 01 Oct 2018, 19:45
Post 01 Oct 2018, 19:45
View user's profile Send private message Visit poster's website Reply with quote
Ben321



Joined: 07 Dec 2017
Posts: 70
Ben321 01 Oct 2018, 22:46
DimonSoft wrote:
Windows 98 DDK might be a good source: http://old-dos.ru/index.php?page=files&mode=files&do=show&id=3661


Russian website, so I doubt any of the documentation is in English. It's probably the Russian version of the DDK. I also don't know if it tells you how to install the driver you create. Most likely just tells you how to compile the driver. They probably already expect you to know how to install the driver after compiling it.

But I downloaded it, and I'll get back to you on whether or not it was useful.
Post 01 Oct 2018, 22:46
View user's profile Send private message Reply with quote
Ben321



Joined: 07 Dec 2017
Posts: 70
Ben321 01 Oct 2018, 22:50
Ok, it was in English, but I don't know how to use it for anything in assembly. It looks like it's meant for C++.
Post 01 Oct 2018, 22:50
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 02 Oct 2018, 08:36
It’s a bad idea to expect the OS developer to write documentation for your particular language. It is even worse idea to use the Internet instead of the official documentation. It’s not how programming works, especially assembly programming.
Post 02 Oct 2018, 08:36
View user's profile Send private message Visit poster's website Reply with quote
ACP



Joined: 23 Sep 2006
Posts: 204
ACP 17 Oct 2018, 12:42
If you are looking for info about some really ancient interfaces like 16/32 Windows here is a book you should take a look into: https://www.amazon.com/Windows-Assembly-Language-Systems-Programming/dp/087930474X

You will still need DDK/SDK files and it would be probably a lot better if you use MASM for that purpose.

Just my 2 cents
Post 17 Oct 2018, 12:42
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.