fbc
fbc copied to clipboard
How to modify FB code to use FB built-in functions in driver development?
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.
- 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'
- 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'
Try linking to libcntpr.lib
which is apparently in the DDK and provides some libc function implementations for drivers.