NO

Author Topic: Writing Windows Kernel Drivers with PellesC,...  (Read 3092 times)

keremg

  • Guest
Writing Windows Kernel Drivers with PellesC,...
« on: April 30, 2008, 03:55:05 AM »
Hi,

well, there is a option that can tell the linker to build a NATIVE PE Image with NATIVE Flag set into the PE Image. I would like to know, how i can build a Windows Kernel Driver with PellesC. I wont link to any HAL or NTKERNEL functions, because i will handle all stuff in assembly language encapsulated by my own libs and C functions i wrote. So my question is. How do i compile such a binary and output a SYS file with PellesC? In general i do this with DDK from MS or VStudio with DDK, but for some little drivers and on-the-fly kernel driver code i wont use DDK and give PellesC a try on this,...if it can to it! Again, no linking against HAL or NTKERNEL or other Kernel Code/Libs!

Can someone show me, how i can do this? Thanks in advance,...


Regards

Kerem

0pc0de

  • Guest
Re: Writing Windows Kernel Drivers with PellesC,...
« Reply #1 on: April 30, 2009, 11:37:30 PM »
Please let me know if you discover how. Here's what I suspect needs to happen:
1) Test the DDK headers/libs as is. Ideally, they'd work.
2) Convert them for Pelles C usage.
3) You'll probably need to use MASM's LINK.EXE. I'm currently studying Four-f's KMD kit. Examine the assembler and linker options.
http://www.freewebs.com/four-f/

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Writing Windows Kernel Drivers with PellesC,...
« Reply #2 on: May 01, 2009, 11:50:34 AM »
A few years back I added the __fastcall calling convention, /cbstring command-line option, and a few more things to the compiler. I also added some options to the linker. I then managed to build a RAM-disk sample as a proof of concept. I can't find that project, and I no longer remember exactly what I did or if I used the Microsoft include files or not (using Microsoft include files for user mode programs usually works, with a few warnings). I have no need to write device drivers myself, so I don't keep up with the progress in this area. Sorry, I can't be of much help here...
/Pelle