3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
12 This following section documents the envirnoment variables for the Win NT
13 build. These variables are used to define the (virtual) hardware
14 configuration of the NT environment
16 A ! can be used to seperate multiple instances in a variable. Each
17 instance represents a seperate hardware device.
19 EFI_WIN_NT_PHYSICAL_DISKS - maps to drives on your system
20 EFI_WIN_NT_VIRTUAL_DISKS - maps to a device emulated by a file
21 EFI_WIN_NT_FILE_SYSTEM - mouts a directory as a file system
22 EFI_WIN_NT_CONSOLE - make a logical comand line window (only one!)
23 EFI_WIN_NT_GOP - Builds GOP Windows of Width and Height
24 EFI_WIN_NT_SERIAL_PORT - maps physical serial ports
25 EFI_WIN_NT_PASS_THRU - associates a device with our PCI support
27 <F>ixed - Fixed disk like a hard drive.
28 <R>emovable - Removable media like a floppy or CD-ROM.
29 Read <O>nly - Write protected device.
30 Read <W>rite - Read write device.
31 <block count> - Decimal number of blocks a device supports.
32 <block size> - Decimal number of bytes per block.
34 NT envirnonment variable contents. '<' and '>' are not part of the variable,
35 they are just used to make this help more readable. There should be no
36 spaces between the ';'. Extra spaces will break the variable. A '!' is
37 used to seperate multiple devices in a variable.
39 EFI_WIN_NT_VIRTUAL_DISKS =
40 <F | R><O | W>;<block count>;<block size>[!...]
42 EFI_WIN_NT_PHYSICAL_DISKS =
43 <drive letter>:<F | R><O | W>;<block count>;<block size>[!...]
45 Virtual Disks: These devices use a file to emulate a hard disk or removable
48 Thus a 20 MB emulated hard drive would look like:
49 EFI_WIN_NT_VIRTUAL_DISKS=FW;40960;512
51 A 1.44MB emulated floppy with a block size of 1024 would look like:
52 EFI_WIN_NT_VIRTUAL_DISKS=RW;1440;1024
54 Physical Disks: These devices use NT to open a real device in your system
56 Thus a 120 MB floppy would look like:
57 EFI_WIN_NT_PHYSICAL_DISKS=B:RW;245760;512
59 Thus a standard CD-ROM floppy would look like:
60 EFI_WIN_NT_PHYSICAL_DISKS=Z:RO;307200;2048
62 EFI_WIN_NT_FILE_SYSTEM =
63 <directory path>[!...]
65 Mounting the two directories C:\FOO and C:\BAR would look like:
66 EFI_WIN_NT_FILE_SYSTEM=c:\foo!c:\bar
71 Declaring a text console window with the title "My EFI Console" woild look like:
72 EFI_WIN_NT_CONSOLE=My EFI Console
75 <width> <height>[!...]
77 Declaring a two GOP windows with resolutions of 800x600 and 1024x768 would look like:
78 Example : EFI_WIN_NT_GOP=800 600!1024 768
80 EFI_WIN_NT_SERIAL_PORT =
83 Declaring two serial ports on COM1 and COM2 would look like:
84 Example : EFI_WIN_NT_SERIAL_PORT=COM1!COM2
86 EFI_WIN_NT_PASS_THROUGH =
87 <BaseAddress>;<Bus#>;<Device#>;<Function#>
89 Declaring a base address of 0xE0000000 (used for PCI Express devices)
90 and having NT32 talk to a device located at bus 0, device 1, function 0:
91 Example : EFI_WIN_NT_PASS_THROUGH=E000000;0;1;0
95 #ifndef __NT_BUS_DRIVER_H__
96 #define __NT_BUS_DRIVER_H__
100 // The package level header files this module uses
103 #include <WinNtDxe.h>
105 // The protocols, PPI and GUID defintions for this module
107 #include <Protocol/WinNtIo.h>
108 #include <Protocol/ComponentName.h>
109 #include <Protocol/WinNtThunk.h>
110 #include <Protocol/DriverBinding.h>
111 #include <Protocol/DevicePath.h>
113 // The Library classes this module consumes
115 #include <Library/DebugLib.h>
116 #include <Library/BaseLib.h>
117 #include <Library/UefiDriverEntryPoint.h>
118 #include <Library/UefiLib.h>
119 #include <Library/PcdLib.h>
120 #include <Library/BaseMemoryLib.h>
121 #include <Library/UefiBootServicesTableLib.h>
122 #include <Library/DevicePathLib.h>
123 #include <Library/MemoryAllocationLib.h>
126 // WinNt Bus Driver Global Variables
128 extern EFI_DRIVER_BINDING_PROTOCOL gWinNtBusDriverBinding
;
129 extern EFI_COMPONENT_NAME_PROTOCOL gWinNtBusDriverComponentName
;
130 extern EFI_COMPONENT_NAME2_PROTOCOL gWinNtBusDriverComponentName2
;
133 // WinNt Bus Controller Structure
135 #define WIN_NT_BUS_DEVICE_SIGNATURE SIGNATURE_32 ('N', 'T', 'B', 'D')
139 EFI_UNICODE_STRING_TABLE
*ControllerNameTable
;
143 // WinNt Child Device Controller Structure
145 #define WIN_NT_IO_DEVICE_SIGNATURE SIGNATURE_32 ('N', 'T', 'V', 'D')
150 EFI_WIN_NT_IO_PROTOCOL WinNtIo
;
151 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
154 // Private data about the parent
156 EFI_HANDLE ControllerHandle
;
157 EFI_DEVICE_PATH_PROTOCOL
*ParentDevicePath
;
159 EFI_UNICODE_STRING_TABLE
*ControllerNameTable
;
163 #define WIN_NT_IO_DEVICE_FROM_THIS(a) \
164 CR(a, WIN_NT_IO_DEVICE, WinNtIo, WIN_NT_IO_DEVICE_SIGNATURE)
167 // This is the largest env variable we can parse
169 #define MAX_NT_ENVIRNMENT_VARIABLE_LENGTH 512
173 EFI_GUID
*DevicePathGuid
;
177 VENDOR_DEVICE_PATH VendorDevicePath
;
179 } WIN_NT_VENDOR_DEVICE_PATH_NODE
;
184 IN EFI_HANDLE ImageHandle
,
185 IN EFI_SYSTEM_TABLE
*SystemTable
191 TODO: Add function description
195 ImageHandle - TODO: add argument description
196 SystemTable - TODO: add argument description
200 TODO: add return values
206 // Driver Binding Protocol function prototypes
210 WinNtBusDriverBindingSupported (
211 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
212 IN EFI_HANDLE Handle
,
213 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
219 TODO: Add function description
223 This - TODO: add argument description
224 Handle - TODO: add argument description
225 RemainingDevicePath - TODO: add argument description
229 TODO: add return values
236 WinNtBusDriverBindingStart (
237 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
238 IN EFI_HANDLE ParentHandle
,
239 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
245 TODO: Add function description
249 This - TODO: add argument description
250 ParentHandle - TODO: add argument description
251 RemainingDevicePath - TODO: add argument description
255 TODO: add return values
262 WinNtBusDriverBindingStop (
263 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
264 IN EFI_HANDLE Handle
,
265 IN UINTN NumberOfChildren
,
266 IN EFI_HANDLE
*ChildHandleBuffer
272 TODO: Add function description
276 This - TODO: add argument description
277 Handle - TODO: add argument description
278 NumberOfChildren - TODO: add argument description
279 ChildHandleBuffer - TODO: add argument description
283 TODO: add return values
289 // WinNt Bus Driver private worker functions
291 EFI_DEVICE_PATH_PROTOCOL
*
292 WinNtBusCreateDevicePath (
293 IN EFI_DEVICE_PATH_PROTOCOL
*RootDevicePath
,
295 IN UINT16 InstanceNumber
301 TODO: Add function description
305 RootDevicePath - TODO: add argument description
306 Guid - TODO: add argument description
307 InstanceNumber - TODO: add argument description
311 TODO: add return values