![]() |
Re: Treiber Handling
Okay so should i use 32 bit with delphi and FPC for 64 or FPC for both.
What do you advise? :) |
Re: Treiber Handling
doesn't matter if both work, does it? ;)
|
Re: Treiber Handling
Yes that is true but how would it look in lazarus the make file?
in delphi i now use this..
Delphi-Quellcode:
Does FPC/lazarus compile only for normal x64 becouse there is IA x64 and AMD x64 :gruebel: :gruebel:
bin\dcc32 -UC:\test1\include -B -CG -JP -$A-,C-,D-,G-,H-,I-,L-,P-,V-,W+,Y- -O+ driver.pas
bin\rmcoff2 driver.obj bin\link /NOLOGO /ALIGN:32 /BASE:0x10000 /SUBSYSTEM:NATIVE /DRIVER /LIBPATH:C:\test1\lib /ENTRY:DriverEntry ntoskrnl.lib hal.lib win32k.lib ntdll.lib ntutils.lib /out:driver.sys driver.obj |
Re: Treiber Handling
Zitat:
Code:
I don't know what options link needs to link a 64-bit file. Perhaps
fpc -FuC:\test1\include -Mdelphi driver.pas
bin\rmcoff2 driver.o bin\link /NOLOGO /ALIGN:32 /BASE:0x10000 /SUBSYSTEM:NATIVE /DRIVER /LIBPATH:C:\test1\lib /ENTRY:DriverEntry ntoskrnl.lib hal.lib win32k.lib ntdll.lib ntutils.lib /out:driver.sys driver.obj
Code:
is enough.
/ALIGN:64
For compiling 64-bit code you also need the 64-bit version of FPC. You can then define the target plattform with
Code:
for 32-bit and
-Pi386
Code:
for 64-bit.
-Px86_64
I currently don't know how to define the switches (after -$ in your code) in the command line, so you might need to define these in your code like this (example for H-):
Delphi-Quellcode:
{$H-}
Zitat:
Note: IA x64 is something completly different to normal 64-bit found on common processors (including Intel processors). So AMD x86 is normally sufficient! Regards, Sven |
Re: Treiber Handling
Thank you for your information.I am a bit amazed that i am the only one that figured this out :)
The driver itself has about 3000 lines of code. Also James what do you think about adding dbpring on exceptions and errors.This would make debuging much easier.Becouse you can then inspect the driver.See whats going on in realtime. Regards, nanix |
Re: Treiber Handling
Zitat:
Zitat:
I don't know how well the Delphi kernel mode handles exceptions, but in the case of my port I've not yet enabled the interaction with system exceptions (like Access Violation, Div By Zero, etc.), but exceptions that are thrown by Pascal code (with raise) are handled if there is a surrounding except block. One should nevertheless catch all exceptions because the result of not doing this might be an infamous BSOD :mrgreen: Regards, Sven |
Re: Treiber Handling
Ah yes James but how are you going to see which line it was if you get an BSOD fast.I think ill add some kind of dump soon as it happens it will dump it to the HDD even before BSOD happens.
|
Re: Treiber Handling
The kernel already creates a dump for you if you enable that (you can sometimes see the progress of saving it on the bottom of a BSOD) and WinDbg can extract the last DbgPrint messages for you out of this dump. That's one of those parts the guys at Microsoft did well :mrgreen:
A note about BSODs: The kernel still runs when a BSOD occurs, that's the reason why it can print to the screen and dump the memory. You can also connect to a NT machine via Null Modem cable and activate the built in kernel debugger. This debugger is also activated when a BSOD occurs, so you can debug around :) (you might need a debug build of Windows to be able to use the kernel debugger, though) Regards, Sven |
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:21 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz