3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 This following section documents the envirnoment variables for the Win NT
19 build. These variables are used to define the (virtual) hardware
20 configuration of the NT environment
22 A ! can be used to seperate multiple instances in a variable. Each
23 instance represents a seperate hardware device.
25 EFI_WIN_NT_PHYSICAL_DISKS - maps to drives on your system
26 EFI_WIN_NT_VIRTUAL_DISKS - maps to a device emulated by a file
27 EFI_WIN_NT_FILE_SYSTEM - mouts a directory as a file system
28 EFI_WIN_NT_CONSOLE - make a logical comand line window (only one!)
29 EFI_WIN_NT_GOP - Builds GOP Windows of Width and Height
30 EFI_WIN_NT_SERIAL_PORT - maps physical serial ports
31 EFI_WIN_NT_PASS_THRU - associates a device with our PCI support
33 <F>ixed - Fixed disk like a hard drive.
34 <R>emovable - Removable media like a floppy or CD-ROM.
35 Read <O>nly - Write protected device.
36 Read <W>rite - Read write device.
37 <block count> - Decimal number of blocks a device supports.
38 <block size> - Decimal number of bytes per block.
40 NT envirnonment variable contents. '<' and '>' are not part of the variable,
41 they are just used to make this help more readable. There should be no
42 spaces between the ';'. Extra spaces will break the variable. A '!' is
43 used to seperate multiple devices in a variable.
45 EFI_WIN_NT_VIRTUAL_DISKS =
46 <F | R><O | W>;<block count>;<block size>[!...]
48 EFI_WIN_NT_PHYSICAL_DISKS =
49 <drive letter>:<F | R><O | W>;<block count>;<block size>[!...]
51 Virtual Disks: These devices use a file to emulate a hard disk or removable
54 Thus a 20 MB emulated hard drive would look like:
55 EFI_WIN_NT_VIRTUAL_DISKS=FW;40960;512
57 A 1.44MB emulated floppy with a block size of 1024 would look like:
58 EFI_WIN_NT_VIRTUAL_DISKS=RW;1440;1024
60 Physical Disks: These devices use NT to open a real device in your system
62 Thus a 120 MB floppy would look like:
63 EFI_WIN_NT_PHYSICAL_DISKS=B:RW;245760;512
65 Thus a standard CD-ROM floppy would look like:
66 EFI_WIN_NT_PHYSICAL_DISKS=Z:RO;307200;2048
68 EFI_WIN_NT_FILE_SYSTEM =
69 <directory path>[!...]
71 Mounting the two directories C:\FOO and C:\BAR would look like:
72 EFI_WIN_NT_FILE_SYSTEM=c:\foo!c:\bar
77 Declaring a text console window with the title "My EFI Console" woild look like:
78 EFI_WIN_NT_CONSOLE=My EFI Console
81 <width> <height>[!...]
83 Declaring a two GOP windows with resolutions of 800x600 and 1024x768 would look like:
84 Example : EFI_WIN_NT_GOP=800 600!1024 768
86 EFI_WIN_NT_SERIAL_PORT =
89 Declaring two serial ports on COM1 and COM2 would look like:
90 Example : EFI_WIN_NT_SERIAL_PORT=COM1!COM2
92 EFI_WIN_NT_PASS_THROUGH =
93 <BaseAddress>;<Bus#>;<Device#>;<Function#>
95 Declaring a base address of 0xE0000000 (used for PCI Express devices)
96 and having NT32 talk to a device located at bus 0, device 1, function 0:
97 Example : EFI_WIN_NT_PASS_THROUGH=E000000;0;1;0
101 #ifndef __NT_BUS_DRIVER_H__
102 #define __NT_BUS_DRIVER_H__
106 // The package level header files this module uses
109 #include <WinNtDxe.h>
111 // The protocols, PPI and GUID defintions for this module
113 #include <Protocol/WinNtIo.h>
114 #include <Protocol/ComponentName.h>
115 #include <Protocol/WinNtThunk.h>
116 #include <Protocol/DriverBinding.h>
117 #include <Protocol/DevicePath.h>
119 // The Library classes this module consumes
121 #include <Library/DebugLib.h>
122 #include <Library/BaseLib.h>
123 #include <Library/UefiDriverEntryPoint.h>
124 #include <Library/UefiLib.h>
125 #include <Library/PcdLib.h>
126 #include <Library/BaseMemoryLib.h>
127 #include <Library/UefiBootServicesTableLib.h>
128 #include <Library/DevicePathLib.h>
129 #include <Library/MemoryAllocationLib.h>
132 // WinNt Bus Driver Global Variables
134 extern EFI_DRIVER_BINDING_PROTOCOL gWinNtBusDriverBinding
;
135 extern EFI_COMPONENT_NAME_PROTOCOL gWinNtBusDriverComponentName
;
136 extern EFI_COMPONENT_NAME2_PROTOCOL gWinNtBusDriverComponentName2
;
139 // WinNt Bus Controller Structure
141 #define WIN_NT_BUS_DEVICE_SIGNATURE SIGNATURE_32 ('N', 'T', 'B', 'D')
145 EFI_UNICODE_STRING_TABLE
*ControllerNameTable
;
149 // WinNt Child Device Controller Structure
151 #define WIN_NT_IO_DEVICE_SIGNATURE SIGNATURE_32 ('N', 'T', 'V', 'D')
156 EFI_WIN_NT_IO_PROTOCOL WinNtIo
;
157 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
160 // Private data about the parent
162 EFI_HANDLE ControllerHandle
;
163 EFI_DEVICE_PATH_PROTOCOL
*ParentDevicePath
;
165 EFI_UNICODE_STRING_TABLE
*ControllerNameTable
;
169 #define WIN_NT_IO_DEVICE_FROM_THIS(a) \
170 CR(a, WIN_NT_IO_DEVICE, WinNtIo, WIN_NT_IO_DEVICE_SIGNATURE)
173 // This is the largest env variable we can parse
175 #define MAX_NT_ENVIRNMENT_VARIABLE_LENGTH 512
179 EFI_GUID
*DevicePathGuid
;
183 VENDOR_DEVICE_PATH VendorDevicePath
;
185 } WIN_NT_VENDOR_DEVICE_PATH_NODE
;
190 IN EFI_HANDLE ImageHandle
,
191 IN EFI_SYSTEM_TABLE
*SystemTable
197 TODO: Add function description
201 ImageHandle - TODO: add argument description
202 SystemTable - TODO: add argument description
206 TODO: add return values
212 // Driver Binding Protocol function prototypes
216 WinNtBusDriverBindingSupported (
217 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
218 IN EFI_HANDLE Handle
,
219 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
225 TODO: Add function description
229 This - TODO: add argument description
230 Handle - TODO: add argument description
231 RemainingDevicePath - TODO: add argument description
235 TODO: add return values
242 WinNtBusDriverBindingStart (
243 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
244 IN EFI_HANDLE ParentHandle
,
245 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
251 TODO: Add function description
255 This - TODO: add argument description
256 ParentHandle - TODO: add argument description
257 RemainingDevicePath - TODO: add argument description
261 TODO: add return values
268 WinNtBusDriverBindingStop (
269 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
270 IN EFI_HANDLE Handle
,
271 IN UINTN NumberOfChildren
,
272 IN EFI_HANDLE
*ChildHandleBuffer
278 TODO: Add function description
282 This - TODO: add argument description
283 Handle - TODO: add argument description
284 NumberOfChildren - TODO: add argument description
285 ChildHandleBuffer - TODO: add argument description
289 TODO: add return values
295 // WinNt Bus Driver private worker functions
297 EFI_DEVICE_PATH_PROTOCOL
*
298 WinNtBusCreateDevicePath (
299 IN EFI_DEVICE_PATH_PROTOCOL
*RootDevicePath
,
301 IN UINT16 InstanceNumber
307 TODO: Add function description
311 RootDevicePath - TODO: add argument description
312 Guid - TODO: add argument description
313 InstanceNumber - TODO: add argument description
317 TODO: add return values