-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Replies: 2 comments · 7 replies
-
Carbon's toolchain is being built on top of Clang and LLVM (for more information, see "How will Carbon work?" in the FAQ). The compiler infrastructure is being integrated very deeply, so in theory Carbon should be able to build anything that Clang/LLVM could. However, this does require deep integration, so other C++ compilers cannot be trivially swapped in. If I understand correctly, what you're asking about requires using MSVC, not Clang/LLVM. As a consequence of the above, what you'd need to do would look more like cross-toolchain interoperability (for an outline of this, see the interoperability goal, "Support mixing Carbon and C++ toolchains"). Rather than dropping MSVC into Carbon, you'd need to use Carbon to build something that MSVC could consume. For example, you could use Clang's MSVC compatibility. That might look like:
Note a similar story exists for other C++ compilers, such as GCC. |
Beta Was this translation helpful? Give feedback.
All reactions
-
My expectation is to write and compile the Windows kernel driver .sys file using carbon. You mean these compilation parameters should be done by llvm right? |
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes, that's clang-cl. It currently does not, but it should if it's going to support driver development:
|
Beta Was this translation helpful? Give feedback.
All reactions
-
I remember someone once successfully compiled sys using clang, I'll look for how it handles this parameter. Also, why hasn't carbon supported Windows until now? Is it because of the troublesome collection of information related to VSwhere? I've written tools for this before. package vswhere
import (
"github.com/ddkwork/golibrary/mylog"
"github.com/ddkwork/golibrary/stream"
"io/fs"
"path/filepath"
"slices"
"strconv"
"strings"
)
// todo move into library
type (
WdkConfig struct {
Root string
Version string
VsInstallDir string
VsVersion string // 2015, 2017, 2019, 2022
VsType string // community professional Enterprise
Includes []string
Libs []string //todo
CC string
Mt string
Ar string
CXX string
Linker string
DevEnvDir string
RcCompiler string
AsmCompiler string
VCInstallDir string
VS170ComnTools string
VCIDEInstallDir string
VCToolsRedistDir string
VCToolsInstallDir string
}
)
//CMAKE_CXX_STANDARD_LIBRARIES
//kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
//
//LIB
//C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\ATLMFC\lib\x64;
//C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\lib\x64;
//C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;
//C:\Program Files (x86)\Windows Kits\10\lib\10.0.26100.0\ucrt\x64;
//C:\Program Files (x86)\Windows Kits\10\\lib\10.0.26100.0\\um\x64
//
//LIBPATH
//C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\ATLMFC\lib\x64;
//C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\lib\x64;
//C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\lib\x86\store\references;
//C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.26100.0;
//C:\Program Files (x86)\Windows Kits\10\References\10.0.26100.0;
//C:\Windows\Microsoft.NET\Framework64\v4.0.30319
func New() (v *WdkConfig) {
return &WdkConfig{
Root: "",
Version: "",
VsInstallDir: "",
VsVersion: "",
VsType: "",
Includes: make([]string, 0),
Libs: make([]string, 0),
Mt: "",
Ar: "",
Linker: "",
DevEnvDir: "",
CC: "",
CXX: "",
RcCompiler: "",
AsmCompiler: "",
VCInstallDir: "",
VS170ComnTools: "",
VCIDEInstallDir: "",
VCToolsRedistDir: "",
VCToolsInstallDir: "",
}
}
func (c *WdkConfig) VisualStudio() *WdkConfig {
// C:\Program Files\Microsoft Visual Studio\2022\Enterprise
var (
versions = []string{
"2015",
"2017",
"2019",
"2022",
}
Types = []string{
"community",
"professional",
"Enterprise",
}
)
for _, version := range versions {
p := filepath.Join("C:\\Program Files\\Microsoft Visual Studio", version)
if stream.IsDir(p) {
c.VsVersion = version
for _, l := range Types {
d := filepath.Join(p, l)
if stream.IsDir(d) {
c.VsInstallDir = filepath.ToSlash(d)
c.VsType = l
break
}
}
break
}
}
mylog.Check(filepath.Walk(c.VsInstallDir, func(path string, info fs.FileInfo, err error) error {
if filepath.Base(path) == "cl.exe" && strings.Contains(path, "Hostx64\\x64") {
path = filepath.ToSlash(path)
c.CC = path
c.CXX = path
return err
}
return err
}))
c.findWdk()
c.Mt = filepath.ToSlash(filepath.Join(c.Root, "bin", c.Version, "x64", "mt.exe"))
c.RcCompiler = filepath.ToSlash(filepath.Join(c.Root, "bin", c.Version, "x64", "rc.exe"))
dir := filepath.Dir(c.CC)
c.AsmCompiler = filepath.ToSlash(filepath.Join(dir, "ml64.exe"))
c.Ar = filepath.ToSlash(filepath.Join(dir, "lib.exe"))
c.Linker = filepath.ToSlash(filepath.Join(dir, "link.exe"))
c.DevEnvDir = filepath.ToSlash(filepath.Join(c.VsInstallDir, "Common7", "IDE"))
VCToolsVersion, ok := stream.CutPath(dir, "MSVC", "bin")
if !ok {
panic("VCToolsVersion not exist")
}
c.VCIDEInstallDir = filepath.ToSlash(filepath.Join(c.VsInstallDir, "Common7", "IDE", "VC"))
c.VCInstallDir = filepath.ToSlash(filepath.Join(c.VsInstallDir, "VC"))
c.VCToolsInstallDir = filepath.ToSlash(filepath.Join(c.VsInstallDir, "VC", "Tools", "MSVC", VCToolsVersion))
c.VCToolsRedistDir = filepath.ToSlash(filepath.Join(c.VsInstallDir, "VC", "Redist", "MSVC", VCToolsVersion))
c.VS170ComnTools = filepath.ToSlash(filepath.Join(c.VsInstallDir, "Common7", "Tools"))
kmdfVersions := make([]string, 0)
root := filepath.Join(c.Root, "Include", "wdf", "kmdf")
mylog.Check(filepath.Walk(root, func(path string, info fs.FileInfo, err error) error {
if info.IsDir() {
if filepath.Base(path) == "kmdf" {
return err
}
kmdfVersions = append(kmdfVersions, filepath.Base(path))
}
return err
}))
for _, s := range []string{"shared", "km", "km/crt"} {
c.Includes = append(c.Includes, filepath.ToSlash(filepath.Join(c.Root, "Include", c.Version, s)))
}
kmdfVersionValues := make([]float64, 0)
for _, version := range kmdfVersions {
split := strings.Split(version, ".")
kmdfVersionValues = append(kmdfVersionValues, mylog.Check2(strconv.ParseFloat(split[1], 64)))
}
kmdfVersionMax := 1.0 + slices.Max(kmdfVersionValues)/100.0
mylog.Success("max wdf kmdf version", kmdfVersionMax)
c.Includes = append(c.Includes, filepath.ToSlash(filepath.Join(root, strconv.FormatFloat(kmdfVersionMax, 'f', 2, 64))))
c.Includes = append(c.Includes, filepath.ToSlash(filepath.Join(c.VsInstallDir, "VC", "Tools", "MSVC", VCToolsVersion, "include")))
c.Includes = append(c.Includes, filepath.ToSlash(filepath.Join(c.VsInstallDir, "VC", "Tools", "MSVC", VCToolsVersion, "ATLMFC", "include")))
c.Includes = append(c.Includes, filepath.ToSlash(filepath.Join(c.VsInstallDir, "VC", "Auxiliary", "VS", "include")))
for _, s := range []string{"ucrt", "um", "shared", "winrt", "cppwinrt"} {
c.Includes = append(c.Includes, filepath.ToSlash(filepath.Join(c.Root, "Include", c.Version, s)))
}
mylog.Struct(c)
return c
}
func (c *WdkConfig) findWdk() (ntddk string) {
for driver := range stream.GetWindowsLogicalDrives() {
driver = filepath.Join(driver, "Program Files (x86)", "Windows Kits")
if stream.IsDir(driver) {
c.Root = filepath.Join(driver, "10") //todo
c.Root = filepath.ToSlash(c.Root)
mylog.Success("wdk root", c.Root)
break
}
}
if c.Root == "" {
panic("wdk root not found")
}
mylog.Check(filepath.WalkDir(c.Root, func(path string, d fs.DirEntry, err error) error {
if filepath.Base(path) == "ntddk.h" {
ntddk = filepath.ToSlash(path)
mylog.Success("ntddk.h", ntddk)
return err
}
return err
}))
//C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/km/ntddk.h
cut, found := stream.CutPath(ntddk, "Include", "km")
if !found {
panic("wdk cut not found")
}
c.Version = cut
mylog.Success("wdk version", c.Version)
return
}
GOROOT=C:\Program Files\Go #gosetup
GOPATH=C:\Users\Admin\go #gosetup
"C:\Program Files\Go\bin\go.exe" test -c -o C:\Users\Admin\AppData\Local\JetBrains\GoLand2024.3\tmp\GoLand\___Test_object_DriverKitPath_in_github_com_ddkwork_bindgen_vswhere.test.exe github.com/ddkwork/bindgen/vswhere #gosetup
"C:\Program Files\Go\bin\go.exe" tool test2json -t C:\Users\Admin\AppData\Local\JetBrains\GoLand2024.3\tmp\GoLand\___Test_object_DriverKitPath_in_github_com_ddkwork_bindgen_vswhere.test.exe -test.v=test2json -test.paniconexit0 -test.run ^\QTest_object_DriverKitPath\E$ #gosetup
2025-04-17 12:14:13 Trace -> --------- key --------- │ ------------------ value ------------------ //runtime.doInit1+0xdc C:/Program Files/Go/src/runtime/proc.go:7350
=== RUN Test_object_DriverKitPath
2025-04-17 12:14:15 Success -> wdk root │ C:/Program Files (x86)/Windows Kits/10 //github.com/ddkwork/bindgen/vswhere.(*WdkConfig).findWdk-range1+0x276 D:/workspace/workspace/bindgen/vswhere/vswhere.go:180
2025-04-17 12:14:15 Success -> ntddk.h │ C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/km/ntddk.h //github.com/ddkwork/bindgen/vswhere.(*WdkConfig).findWdk.func1+0xfa D:/workspace/workspace/bindgen/vswhere/vswhere.go:191
2025-04-17 12:14:16 Success -> wdk version │ 10.0.26100.0 //github.com/ddkwork/bindgen/vswhere.(*WdkConfig).findWdk+0x3d2 D:/workspace/workspace/bindgen/vswhere/vswhere.go:203
2025-04-17 12:14:16 Success -> max wdf kmdf version │ 1.33 //github.com/ddkwork/bindgen/vswhere.(*WdkConfig).VisualStudio+0x111c D:/workspace/workspace/bindgen/vswhere/vswhere.go:162
2025-04-17 12:14:16 Struct -> │
WdkConfig {
Root: "C:/Program Files (x86)/Windows Kits/10",
Version: "10.0.26100.0",
VsInstallDir: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise",
VsVersion: "2022",
VsType: "Enterprise",
Includes: [
<0> "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/shared",
<1> "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/km",
<2> "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/km/crt",
<3> "C:/Program Files (x86)/Windows Kits/10/Include/wdf/kmdf/1.33",
<4> "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/include",
<5> "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/ATLMFC/include",
<6> "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/VS/include",
<7> "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/ucrt",
<8> "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um",
<9> "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/shared",
<10> "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/winrt",
<11> "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/cppwinrt"
],
Libs: [
],
CC: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe",
Mt: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/mt.exe",
Ar: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/lib.exe",
CXX: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe",
Linker: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/link.exe",
DevEnvDir: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE",
RcCompiler: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/rc.exe",
AsmCompiler: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/ml64.exe",
VCInstallDir: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC",
VS170ComnTools: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/Tools",
VCIDEInstallDir: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/VC",
VCToolsRedistDir: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Redist/MSVC/14.42.34433",
VCToolsInstallDir: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433"
}
//github.com/ddkwork/bindgen/vswhere.(*WdkConfig).VisualStudio+0x19a9 D:/workspace/workspace/bindgen/vswhere/vswhere.go:170
--- PASS: Test_object_DriverKitPath (2.74s)
PASS
Process finished with the exit code 0
package main
import (
"fmt"
"os"
"path/filepath"
"runtime"
"sort"
"strings"
)
type WdkConfig struct {
Root string
Version string
WinVer string
NtddkVersion string
Platform string
CompileFlags []string
CompileDefs []string
LinkFlags []string
LibVersion string
IncVersion string
Architecture string
IncludeDirs []string
Libraries []string
}
func findWdk() (*WdkConfig, error) {
var wdkNtddkFiles []string
wdkContentRoot := os.Getenv("WDKContentRoot")
if wdkContentRoot != "" {
err := filepath.Walk(wdkContentRoot, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if filepath.Base(path) == "ntddk.h" {
wdkNtddkFiles = append(wdkNtddkFiles, path)
}
return nil
})
if err != nil {
return nil, err
}
} else {
paths := []string{
"C:/Program Files*/Windows Kits/*/Include/*/km/ntddk.h",
"C:/Program Files*/Windows Kits/*/Include/km/ntddk.h",
}
for _, path := range paths {
matches, err := filepath.Glob(path)
if err != nil {
return nil, err
}
wdkNtddkFiles = append(wdkNtddkFiles, matches...)
}
}
if len(wdkNtddkFiles) > 0 {
sort.Strings(wdkNtddkFiles)
wdkLatestNtddkFile := wdkNtddkFiles[len(wdkNtddkFiles)-1]
wdkRoot := filepath.Dir(filepath.Dir(wdkLatestNtddkFile))
wdkVersion := filepath.Base(wdkRoot)
wdkRoot = filepath.Dir(wdkRoot)
wdkConfig := &WdkConfig{
Root: wdkRoot,
Version: wdkVersion,
WinVer: "0x0601",
NtddkVersion: "",
LibVersion: wdkVersion,
IncVersion: wdkVersion,
Architecture: "",
CompileFlags: []string{"/Zp8", "/GF", "/GR-", "/Gz", "/kernel", "/FIwarning.h", "/FIwdkflags.h", "/Oi"},
CompileDefs: []string{"WINNT=1"},
LinkFlags: []string{"/MANIFEST:NO", "/DRIVER", "/OPT:REF", "/INCREMENTAL:NO", "/OPT:ICF", "/SUBSYSTEM:NATIVE", "/MERGE:_TEXT=.text;_PAGE=PAGE", "/NODEFAULTLIB", "/SECTION:INIT,d", "/VERSION:10.0"},
}
if !strings.Contains(wdkRoot, "/[0-9][0-9.]*") {
wdkRoot = filepath.Dir(wdkRoot)
wdkConfig.Root = wdkRoot
wdkConfig.LibVersion = wdkVersion
wdkConfig.IncVersion = wdkVersion
} else {
wdkConfig.IncVersion = ""
versions := []string{"winv6.3", "win8", "win7"}
for _, version := range versions {
if _, err := os.Stat(filepath.Join(wdkRoot, "Lib", version)); err == nil {
wdkConfig.LibVersion = version
wdkConfig.Version = version
break
}
}
}
// Determine the architecture
architecture := os.Getenv("CMAKE_CXX_COMPILER_ARCHITECTURE_ID")
architecture = runtime.GOARCH
switch architecture {
case "x86":
wdkConfig.Architecture = "x86"
wdkConfig.CompileDefs = append(wdkConfig.CompileDefs, "_X86_=1", "i386=1", "STD_CALL")
case "ARM64":
wdkConfig.Architecture = "arm64"
wdkConfig.CompileDefs = append(wdkConfig.CompileDefs, "_ARM64_", "ARM64", "_USE_DECLSPECS_FOR_SAL=1", "STD_CALL")
case "AMD64":
wdkConfig.Architecture = "x64"
wdkConfig.CompileDefs = append(wdkConfig.CompileDefs, "_AMD64_", "AMD64")
default:
return nil, fmt.Errorf("Unsupported architecture")
}
// Set include directories
wdkConfig.IncludeDirs = []string{
filepath.Join(wdkConfig.Root, "Include", wdkConfig.IncVersion, "shared"),
filepath.Join(wdkConfig.Root, "Include", wdkConfig.IncVersion, "km"),
filepath.Join(wdkConfig.Root, "Include", wdkConfig.IncVersion, "km/crt"),
}
// Set libraries
libPath := filepath.Join(wdkConfig.Root, "Lib", wdkConfig.LibVersion, "km", wdkConfig.Platform, "*.lib")
matches, err := filepath.Glob(libPath)
if err != nil {
return nil, err
}
for _, match := range matches {
wdkConfig.Libraries = append(wdkConfig.Libraries, match)
}
return wdkConfig, nil
}
return nil, fmt.Errorf("WDK not found")
}
func main() {
wdkConfig, err := findWdk()
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("WDK_ROOT: %s\n", wdkConfig.Root)
fmt.Printf("WDK_VERSION: %s\n", wdkConfig.Version)
fmt.Printf("WDK_COMPILE_FLAGS: %v\n", wdkConfig.CompileFlags)
fmt.Printf("WDK_COMPILE_DEFINITIONS: %v\n", wdkConfig.CompileDefs)
fmt.Printf("WDK_LINK_FLAGS: %v\n", wdkConfig.LinkFlags)
fmt.Printf("WDK_INCLUDE_DIRS: %v\n", wdkConfig.IncludeDirs)
fmt.Printf("WDK_LIBRARIES: %v\n", wdkConfig.Libraries)
// Simulate adding a driver and library
if wdkConfig.Architecture == "x86" {
wdkConfig.CompileFlags = append(wdkConfig.CompileFlags, "/ENTRY:FxDriverEntry@8")
} else if wdkConfig.Architecture == "arm64" || wdkConfig.Architecture == "x64" {
wdkConfig.CompileFlags = append(wdkConfig.CompileFlags, "/ENTRY:FxDriverEntry")
}
// Simulate including additional flags file
additionalFlagsFile := filepath.Join(os.Getenv("CMAKE_CURRENT_BINARY_DIR"), os.Getenv("CMAKE_FILES_DIRECTORY"), "wdkflags.h")
if err := os.WriteFile(additionalFlagsFile, []byte("#pragma runtime_checks(\"suc\", off)"), 0644); err != nil {
fmt.Println(err)
return
}
// Simulate compile definitions for debug mode
if os.Getenv("CMAKE_BUILD_TYPE") == "Debug" {
wdkConfig.CompileDefs = append(wdkConfig.CompileDefs, "MSC_NOOPT", "DEPRECATE_DDK_FUNCTIONS=1", "DBG=1")
}
// Simulate setting NTDDI_VERSION if specified
if wdkConfig.NtddkVersion != "" {
wdkConfig.CompileDefs = append(wdkConfig.CompileDefs, fmt.Sprintf("NTDDI_VERSION=%s", wdkConfig.NtddkVersion))
}
// Simulate setting KMDF if specified
if kmdfVersion := os.Getenv("WDK_KMDF"); kmdfVersion != "" {
wdkConfig.IncludeDirs = append(wdkConfig.IncludeDirs, filepath.Join(wdkConfig.Root, "Include", "wdf", "kmdf", kmdfVersion))
wdkConfig.Libraries = append(wdkConfig.Libraries,
filepath.Join(wdkConfig.Root, "Lib", "wdf", "kmdf", wdkConfig.Platform, kmdfVersion, "WdfDriverEntry.lib"),
filepath.Join(wdkConfig.Root, "Lib", "wdf", "kmdf", wdkConfig.Platform, kmdfVersion, "WdfLdr.lib"),
)
}
// Simulate setting platform specific libraries
if wdkConfig.Architecture == "arm64" {
wdkConfig.Libraries = append(wdkConfig.Libraries, "arm64rt.lib")
}
if wdkConfig.Architecture == "x86" {
wdkConfig.Libraries = append(wdkConfig.Libraries, "wdk::MEMCMP")
}
fmt.Printf("WDK_COMPILE_FLAGS (final): %v\n", wdkConfig.CompileFlags)
fmt.Printf("WDK_COMPILE_DEFINITIONS (final): %v\n", wdkConfig.CompileDefs)
fmt.Printf("WDK_LINK_FLAGS (final): %v\n", wdkConfig.LinkFlags)
fmt.Printf("WDK_INCLUDE_DIRS (final): %v\n", wdkConfig.IncludeDirs)
fmt.Printf("WDK_LIBRARIES (final): %v\n", wdkConfig.Libraries)
} |
Beta Was this translation helpful? Give feedback.
All reactions
-
Sure, thanks.
You can see the roadmap here. Broader platform support will come after getting more of the toolchain built out. It's not part of the 0.1 milestone. |
Beta Was this translation helpful? Give feedback.
All reactions
-
The following languages are currently doing bindings for wdk:. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Even csharp has been compiled by people, though I haven't tested it successfully, and only rust has been tested successfully so far, except for c and cpp. If c or cpp had a compiler-level package management tool, such as a module for cpp20, it wouldn't be such a tangle. Without the concept of packages and modules, code reuse would be too hard and function names would be long, readability would be better with packages. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
hi,can you make a "new carbon project as windows kernel driver" template use these commands:
carbon -cc msvc -kernel -o driver.sys driver.v
-DUNICODE -D_UNICODE
-DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DNTDDI_VERSION=0x06000000
-I"C:\WinDDK\7600.16385.1\inc\ddk"
-Wl,/entry:DriverEntry -Wl,/subsystem:native -Wl,/nodefaultlib
-lntoskrnl.lib -lhal.lib
Beta Was this translation helpful? Give feedback.
All reactions