Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to modify FB code to use FB built-in functions in driver development? #367

Open
MOODSKY2002 opened this issue May 28, 2022 · 1 comment

Comments

@MOODSKY2002
Copy link

I just want to know if it is possible for me to modify FB code to solve the problem, if it is not possible. I had to find another way to deal with it. For strings, for example, I now use the kernel string function to assign and add values, which is also useful, but inconvenient.

  1. Add code if driver compilation is normal:
    dim aa() as string
    Libfb. A did not consider the RING0 layer, but I do not know how to modify to normal)

E:\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe GoDriver.o --subsystem=native --image-base=0x10000 --exclude-all-symbols --entry=DriverEntry@8 --nostdlib -shared -L "E:\1新代码\1GO驱动\lib" -l ntoskrnl_7 -l FBDDK -L D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64 -l fb -o GoDriver.sys
D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe: D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64/libfb.a(array_erase.o):array_erase.c:(.text+0x31): undefined reference to free' D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe: D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64/libfb.a(array_resetdesc.o):array_resetdesc.c:(.text+0x30): undefined reference to memset'
D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe: D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64/libfb.a(str_del.o):str_del.c:(.text+0x16): undefined reference to free' D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe: D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64/libfb.a(thread_ctx.o):thread_ctx.c:(.text+0x35): undefined reference to calloc'
D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe: D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64/libfb.a(thread_ctx.o):thread_ctx.c:(.text+0x8e): undefined reference to free' D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe: D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64/libfb.a(array_clear.o):array_clear.c:(.text+0x17): undefined reference to memset'

  1. Add code if driver compilation is normal:
    dim aa as zstring * 128
    aa="123"
    The following error was reported:

E:\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe GoDriver.o --subsystem=native --image-base=0x10000 --exclude-all-symbols --entry=DriverEntry@8 --nostdlib -shared -L "E:\1新代码\1GO驱动\lib" -l ntoskrnl_7 -l FBDDK -L D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64 -l fb -o GoDriver.sys
D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe: D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64/libfb.a(array_erase.o):array_erase.c:(.text+0x31): undefined reference to free' D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe: D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64/libfb.a(array_resetdesc.o):array_resetdesc.c:(.text+0x30): undefined reference to memset'
D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe: D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64/libfb.a(str_del.o):str_del.c:(.text+0x16): undefined reference to free' D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe: D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64/libfb.a(thread_ctx.o):thread_ctx.c:(.text+0x35): undefined reference to calloc'
D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe: D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64/libfb.a(thread_ctx.o):thread_ctx.c:(.text+0x8e): undefined reference to free' D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\bin\win64\ld.exe: D:\1驱动开发\FreeBASIC-1.09.0-win64-winlibs-gcc-9.3.0\lib\win64/libfb.a(array_clear.o):array_clear.c:(.text+0x17): undefined reference to memset'

@rversteegen
Copy link
Member

Try linking to libcntpr.lib which is apparently in the DDK and provides some libc function implementations for drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants