You are on page 1of 190

OS

Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Harry Hsiung
Harry Hsiung
Intel Corporation
Intel Corporation
EFI TME
EFI TME
Dupont
Dupont
Washington
Washington

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Overview
Overview
l l
Documentation
Documentation
l l
Shell and Boot Manager
Shell and Boot Manager
l l
Directory Structure
Directory Structure
l l
Development Environments
Development Environments
l l
EFI Application Toolkit Overview
EFI Application Toolkit Overview
l l
Sample Applications
Sample Applications
l l
EFI/SAL Integration
EFI/SAL Integration
l l
Open Lab
Open Lab

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Mark Doran
Program Manager
Intel Corporation
October 13, 1999

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Why change?
Why change?
l l
What is EFI?
What is EFI?
l l
EFI enabling
EFI enabling
l l
Summary and Q&A
Summary and Q&A

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Why Change?
Why Change?
B
o
o
t

p
r
o
c
e
s
s
O
p
t
i
o
n

R
O
M
s
M
a
n
u
f
a
c
t
u
r
i
n
g

t
e
s
t

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Why Change?
Why Change?
B
o
o
t

p
r
o
c
e
s
s
O
p
t
i
o
n

R
O
M
s
M
a
n
u
f
a
c
t
u
r
i
n
g

t
e
s
t

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Why Change?
Why Change?
Code
Real Mode
Assembler
Spaghetti
Scalability
Complexity
Maintenance
Issue
Spec
None! Compatibility
OS Loader
Tied to HW
and BIOS
Slows innovation
Carries legacy
New Architecture Required
New Architecture Required

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Why Change?
Why Change?
l l
Interface specification
Interface specification
u uImplementation agnostic Implementation agnostic
l l
Abstracts BIOS from OS
Abstracts BIOS from OS
u uDecouples development Decouples development
l l
Compatible by design
Compatible by design
u uEvolution, not revolution Evolution, not revolution
l l
Modular and extensible
Modular and extensible
u uOS OS- -Neutral value add Neutral value add
l l
Complements existing interfaces
Complements existing interfaces
OS
Loader
Hardware
BIOS
EFI
Flexible to meet existing
and future needs
Flexible to meet existing
and future needs

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Why Change?
Why Change?
l l
Interface specification
Interface specification
u uImplementation agnostic Implementation agnostic
l l
Abstracts BIOS from OS
Abstracts BIOS from OS
u uDecouples development Decouples development
l l
Compatible by design
Compatible by design
u uEvolution, not revolution Evolution, not revolution
l l
Modular and extensible
Modular and extensible
u uOS OS- -Neutral value add Neutral value add
l l
Complements existing interfaces
Complements existing interfaces
OS
Loader
Hardware
BIOS
EFI
Flexible to meet existing
and future needs
Flexible to meet existing
and future needs
C
o
m
p
a
t
i
b
i
l
i
t
y

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Why Change?
Why Change?
Code
Real Mode
Assembler
Spaghetti
Scaleability
Complexity
Maintenance
Issue
Spec
None! Compatibility
OS Loader
Tied to HW
and BIOS
Slows innovation
Carries legacy
The right solution
The right solution

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Why Change?
Why Change?
Code
Real Mode
Assembler
Spaghetti
Scaleability
Complexity
Maintenance
Issue
Spec
None! Compatibility
OS Loader
Tied to HW
and BIOS
Slows innovation
Carries legacy
H
i
g
h

l
e
v
e
l

l
a
n
g
u
a
g
e

p
r
o
t
e
c
t
e
d

m
o
d
e

c
o
d
e
S
c
a
l
e
a
b
l
e

a
n
d

e
a
s
y

t
o

m
a
i
n
t
a
i
n
The right solution
The right solution

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Why Change?
Why Change?
Code
Real Mode
Assembler
Spaghetti
Scaleability
Complexity
Maintenance
Issue
Spec
None! Compatibility
OS Loader
Tied to HW
and BIOS
Slows innovation
Carries legacy
H
i
g
h

l
e
v
e
l

l
a
n
g
u
a
g
e

p
r
o
t
e
c
t
e
d

m
o
d
e

c
o
d
e
S
c
a
l
e
a
b
l
e

a
n
d

e
a
s
y

t
o

m
a
i
n
t
a
i
n
S
t
r
a
i
g
h
t
-
f
o
r
w
a
r
d

i
m
p
l
e
m
e
n
t
a
t
i
o
n
C
l
e
a
r
l
y

d
e
f
i
n
e
d
The right solution
The right solution

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Why Change?
Why Change?
Code
Real Mode
Assembler
Spaghetti
Scaleability
Complexity
Maintenance
Issue
Spec
None! Compatibility
OS Loader
Tied to HW
and BIOS
Slows innovation
Carries legacy
H
i
g
h

l
e
v
e
l

l
a
n
g
u
a
g
e

p
r
o
t
e
c
t
e
d

m
o
d
e

c
o
d
e
S
c
a
l
e
a
b
l
e

a
n
d

e
a
s
y

t
o

m
a
i
n
t
a
i
n
S
t
r
a
i
g
h
t
-
f
o
r
w
a
r
d

i
m
p
l
e
m
e
n
t
a
t
i
o
n
C
l
e
a
r
l
y

d
e
f
i
n
e
d
I
n
n
o
v
a
t
i
o
n
L
e
g
a
c
y

m
i
g
r
a
t
i
o
n
A
b
s
t
r
a
c
t
i
o
n
The right solution
The right solution

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Why Change?
Why Change?
l l IA64 intercept IA64 intercept
u uGolden opportunity Golden opportunity
New operating systems New operating systems
New hardware platform New hardware platform
l l Downstream benefits for IA64 Downstream benefits for IA64
u uLegacy migration Legacy migration
u uScaleability Scaleability
u uExtensibility Extensibility
Security Security
Manageability Manageability
Diagnostics Diagnostics
IA64
Hardware
EFI
BIOS
IA64
apps
IA32
apps
Legacy
BIOS
IA32
OS
IA64
OS
IA64/EFI : the perfect match
IA64/EFI : the perfect match

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Why Change?
Why Change?
l l IA64 intercept IA64 intercept
u uGolden opportunity Golden opportunity
New operating systems New operating systems
New hardware platform New hardware platform
l l Downstream benefits for IA64 Downstream benefits for IA64
u uLegacy migration Legacy migration
u uScaleability Scaleability
u uExtensibility Extensibility
Security Security
Manageability Manageability
Diagnostics Diagnostics
IA64
Hardware
EFI
BIOS
IA64
apps
IA32
apps
Legacy
BIOS
IA32
OS
IA64
OS
EFI
BIOS
IA64/EFI : the perfect match
IA64/EFI : the perfect match

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
OS loader only
OS loader only
uses EFI
uses EFI
l l
EFI compiled in
EFI compiled in
native code
native code
l l
EFI implemented
EFI implemented
in C Language
in C Language
l l
MFG environment
MFG environment
migrated to EFI
migrated to EFI
OS
Loader
Hardware
EFI
MFG test
code
Hardware
EFI
factory user
Simple documented API
Simple documented API

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
M
a
n
u
f
a
c
t
u
r
i
n
g

t
e
s
t
O
p
t
i
o
n

R
O
M
s
B
o
o
t

p
r
o
c
e
s
s
Why Change?
Why Change?
Golden opportunity for change
Golden opportunity for change

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
M
a
n
u
f
a
c
t
u
r
i
n
g

t
e
s
t
O
p
t
i
o
n

R
O
M
s
B
o
o
t

p
r
o
c
e
s
s
Why Change?
Why Change?
Golden opportunity for change
Golden opportunity for change

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
M
a
n
u
f
a
c
t
u
r
i
n
g

t
e
s
t
O
p
t
i
o
n

R
O
M
s
B
o
o
t

p
r
o
c
e
s
s
Why Change?
Why Change?
Golden opportunity for change
Golden opportunity for change

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Why change?
Why change?

What is EFI?
What is EFI?
l l
Benefits
Benefits
l l
Implementation
Implementation

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
PLATFORM HARDWARE
What is EFI?
What is EFI?
PLATFORM SPECIFIC FIRMWARE (SAL)

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
PLATFORM HARDWARE
What is EFI?
What is EFI?
PLATFORM SPECIFIC FIRMWARE (SAL)
OPERATING SYSTEM
Legacy OS LOADER
Compatibility

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
PLATFORM HARDWARE
What is EFI?
What is EFI?
PLATFORM SPECIFIC FIRMWARE (SAL)
OPERATING SYSTEM
Legacy OS LOADER
Compatibility
(OTHER)
SMBIOS
ACPI
INTERFACES
FROM
OTHER
REQUIRED
SPECS

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
PLATFORM HARDWARE
What is EFI?
What is EFI?
PLATFORM SPECIFIC FIRMWARE (SAL)
OPERATING SYSTEM
Legacy OS LOADER
Compatibility
(OTHER)
SMBIOS
ACPI
INTERFACES
FROM
OTHER
REQUIRED
SPECS
EFI OS LOADER

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
PLATFORM HARDWARE
What is EFI?
What is EFI?
PLATFORM SPECIFIC FIRMWARE (SAL)
OPERATING SYSTEM
Legacy OS LOADER
Compatibility
(OTHER)
SMBIOS
ACPI
INTERFACES
FROM
OTHER
REQUIRED
SPECS
EFI OS LOADER
EFI BOOT SERVICES

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
PLATFORM HARDWARE
What is EFI?
What is EFI?
PLATFORM SPECIFIC FIRMWARE (SAL)
OPERATING SYSTEM
Legacy OS LOADER
Compatibility
(OTHER)
SMBIOS
ACPI
INTERFACES
FROM
OTHER
REQUIRED
SPECS
EFI OS LOADER
EFI BOOT SERVICES
EFI
RUNTIME
SERVICES

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
PLATFORM HARDWARE
What is EFI?
What is EFI?
PLATFORM SPECIFIC FIRMWARE (SAL)
OPERATING SYSTEM
Legacy OS LOADER
Compatibility
(OTHER)
SMBIOS
ACPI
INTERFACES
FROM
OTHER
REQUIRED
SPECS
EFI OS LOADER
EFI BOOT SERVICES
EFI
RUNTIME
SERVICES
OS PARTITION
EFI OS
Loader
EFI SYSTEM
PARTITION

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
PLATFORM HARDWARE
What is EFI?
What is EFI?
PLATFORM SPECIFIC FIRMWARE (SAL)
OPERATING SYSTEM
Legacy OS LOADER
Compatibility
(OTHER)
SMBIOS
ACPI
INTERFACES
FROM
OTHER
REQUIRED
SPECS
EFI OS LOADER
EFI BOOT SERVICES
EFI
RUNTIME
SERVICES
OS PARTITION
EFI OS
Loader
EFI SYSTEM
PARTITION
M
e
m
o
r
y
T
i
m
e
r
D
r
i
v
e
r
D
r
i
v
e
r
D
r
i
v
e
r
Boot
Devices
Protocols +
Handlers

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
PLATFORM HARDWARE
What is EFI?
What is EFI?
PLATFORM SPECIFIC FIRMWARE (SAL)
OPERATING SYSTEM
Legacy OS LOADER
Compatibility
(OTHER)
SMBIOS
ACPI
INTERFACES
FROM
OTHER
REQUIRED
SPECS
EFI OS LOADER
EFI BOOT SERVICES
EFI
RUNTIME
SERVICES
OS PARTITION
EFI OS
Loader
EFI SYSTEM
PARTITION
M
e
m
o
r
y
T
i
m
e
r
D
r
i
v
e
r
D
r
i
v
e
r
D
r
i
v
e
r
Boot
Devices
Protocols +
Handlers
EFI API
EFI API EFI API

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?
What is EFI?
Platform
Init
Standard
firmware
platform
initialization
Boot Manager
EFI binaries
API specified
Value add implementation
EFI
Boot code
Failure Failure Failure
Boot Services
Terminate
Operation
handed off
to OS loader
OS Loader
OS
Booted
d

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?
What is EFI?
Platform
Init
Standard
firmware
platform
initialization
Boot Manager
EFI binaries
API specified
Value add implementation
EFI Image
Load
EFI
Driver
Drivers and
applications
loaded
iteratively
EFI
Boot code
Failure Failure Failure
Boot Services
Terminate
Operation
handed off
to OS loader
OS Loader
OS
Booted
d

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?
What is EFI?
Platform
Init
Standard
firmware
platform
initialization
Boot Manager
EFI binaries
API specified
Value add implementation
EFI Image
Load
EFI
Driver
Drivers and
applications
loaded
iteratively
EFI
Application
age
d
EFI
Boot code
Failure Failure Failure
Boot Services
Terminate
Operation
handed off
to OS loader
OS Loader
OS
Booted
d

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?
What is EFI?
Platform
Init
Standard
firmware
platform
initialization
Boot Manager
EFI binaries
API specified
Value add implementation
EFI Image
Load
EFI
Driver
Drivers and
applications
loaded
iteratively
EFI
Application
age
d
EFI
OS Loader
Load
Boot from
ordered list
of EFI OS
loaders
EFI
Boot code
Failure Failure Failure
Boot Services
Terminate
Operation
handed off
to OS loader
OS Loader
OS
Booted
d

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?
What is EFI?
Platform
Init
Standard
firmware
platform
initialization
Boot Manager
EFI binaries
API specified
Value add implementation
EFI Image
Load
EFI
Driver
Drivers and
applications
loaded
iteratively
EFI
Application
age
d
EFI
OS Loader
Load
Boot from
ordered list
of EFI OS
loaders
EFI
Boot code
Failure Failure Failure
Boot Services
Terminate
Operation
handed off
to OS loader
OS Loader
OS
Booted
d

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?
What is EFI?
Platform
Init
Standard
firmware
platform
initialization
Boot Manager
EFI binaries
API specified
Value add implementation
EFI Image
Load
EFI
Driver
Drivers and
applications
loaded
iteratively
EFI
Application
age
d
EFI
OS Loader
Load
Boot from
ordered list
of EFI OS
loaders
EFI
Boot code
Failure Failure Failure
Boot Services
Terminate
Operation
handed off
to OS loader
OS Loader
OS
Booted
d

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?
What is EFI?
Platform
Init
Standard
firmware
platform
initialization
Boot Manager
EFI binaries
API specified
Value add implementation
EFI Image
Load
EFI
Driver
Drivers and
applications
loaded
iteratively
EFI
Application
age
d
EFI
OS Loader
Load
Boot from
ordered list
of EFI OS
loaders
Retry
EFI
Boot code
Failure Failure Failure
Boot Services
Terminate
Operation
handed off
to OS loader
OS Loader
OS
Booted
d

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?
What is EFI?
Platform
Init
Standard
firmware
platform
initialization
Boot Manager
EFI binaries
API specified
Value add implementation
EFI Image
Load
EFI
Driver
Drivers and
applications
loaded
iteratively
EFI
Application
age
d
EFI
OS Loader
Load
Boot from
ordered list
of EFI OS
loaders
Retry
EFI API
EFI API
EFI
Boot code
Failure Failure Failure
Boot Services
Terminate
Operation
handed off
to OS loader
OS Loader
OS
Booted
d

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?
What is EFI?
Architectural Sharing
System partition
Location for OS loaders
Applications and drivers
FAT32 Format
FAT32 spec now public
Tried and tested format
Readily available tools
New Partition Structure
64 bit partition sizes
Unlimited # of partitions
Co-exists w/ legacy MBR
Interoperability layout
Multiple system partitions
Supports multiple OS
installs
Designed for flexibility
Designed for flexibility

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
P
a
r
t
i
t
i
o
n
T
a
b
l
e

H
D
R
Partition 1
M
B
R
P
a
r
t
i
t
i
o
n
T
a
b
l
e

H
D
R
0 1 n
...
LBA0
LBA1 LBAn
Start partition
End partition Start partition
Primary Partition
Table
Backup Partition
Table
0 1 n
...
End partition
First useable block
Last useable block
What is EFI?
What is EFI?

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
DISKPART.
DISKPART.
efi
efi
-
-
creates EFI GPT (
creates EFI GPT (
GUIDed
GUIDed
partition table) system partition
partition table) system partition
l l
EFICHK.
EFICHK.
efi
efi
-
-
checks EFI GPT
checks EFI GPT
parition
parition
for
for
correctness
correctness
l l
EFIFMT.
EFIFMT.
efi
efi
-
-
formats GPT system partition
formats GPT system partition
or standard FAT formats
or standard FAT formats
l l
Part of NT64 setup
Part of NT64 setup
cds
cds
and on EFI website
and on EFI website

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?
What is EFI?
l l
Hard disk
Hard disk
l l
Removable media
Removable media
u uCD CD- -ROM, DVD ROM, DVD- -ROM ROM
El Torito 1.0 No emulation El Torito 1.0 No emulation
u uFloppy, LS Floppy, LS- -120 120 SuperDisk SuperDisk*, Iomega* Zip, Fujitsu* *, Iomega* Zip, Fujitsu*
MO etc. MO etc.
l l
Network
Network
u uPXE BIOS support specification (WfM) PXE BIOS support specification (WfM)
l l
Future media via extensibility methods
Future media via extensibility methods
* All trademarks and brands are the property of their respective owners
Full device support
Full device support

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?
What is EFI?
l l
EFI System table
EFI System table
l l
Runtime services
Runtime services
l l
Boot services
Boot services
l l
Protocols
Protocols
l l
GUIDs
GUIDs

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?: Services and Protocols
What is EFI?: Services and Protocols
l l
Binds EFI services to all EFI protocols
Binds EFI services to all EFI protocols
and applications
and applications
l l
Pointer to system table is passed to
Pointer to system table is passed to
image at initialization
image at initialization

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?: Services and Protocols
What is EFI?: Services and Protocols
EFI System Table Pointer
Runtime Services ptr
Boot Services ptr
Boot Services
Runtime Services

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?: Services and Protocols
What is EFI?: Services and Protocols
l l
Boot time and runtime
Boot time and runtime
l l
Timer, Wakeup alarm
Timer, Wakeup alarm
u u
Requires processor sync in MP systems
Requires processor sync in MP systems
u u
Opens path to future legacy migration
Opens path to future legacy migration
l l
Variables
Variables
u u
Boot manager handshake
Boot manager handshake
l l
System reset
System reset
Minimal set to meet OSV needs
Minimal set to meet OSV needs

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?: Services and Protocols
What is EFI?: Services and Protocols
l l
Events and notifications
Events and notifications
u u
Polled devices, no interrupts
Polled devices, no interrupts
l l
Watchdog timer
Watchdog timer
u u
Elegant recovery
Elegant recovery
l l
Memory allocation
Memory allocation
l l
Handle location
Handle location
l l
Image loading
Image loading
u u
Drivers, applications, OS loader
Drivers, applications, OS loader
Complete, but size efficient
Complete, but size efficient

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?: Services and Protocols
What is EFI?: Services and Protocols
l l
GUID, Interface Structure, Services
GUID, Interface Structure, Services
u u DEVICE_PATH, DEVICE_IO, BLOCK_IO, DISK_IO, FILE_SYSTEM, DEVICE_PATH, DEVICE_IO, BLOCK_IO, DISK_IO, FILE_SYSTEM,
SIMPLE_INPUT, SIMPLE_TEXT_OUTPUT, SERIAL_IO, PXE_BC, SIMPLE_INPUT, SIMPLE_TEXT_OUTPUT, SERIAL_IO, PXE_BC,
SIMPLE_NETWORK, LOAD_FILE, UNICODE_COLLATION SIMPLE_NETWORK, LOAD_FILE, UNICODE_COLLATION
Handle
GUID Interface
GUID Interface
... ...
Protocol Interface
Function pointer
Device specific
context
Function pointer
...
HandleProtocol(GUID..)
BlkIo->ReadBlocks(BlkIo, )
EFI Driver

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?: Services and Protocols
What is EFI?: Services and Protocols
OS Loader
EFI Firmware
Driver
PC-AT KBD
USB thunk
Legacy BIOS
Keyboard
Simple_text_in
Initial implementation
Simplified
design
Simplified
design

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?: Services and Protocols
What is EFI?: Services and Protocols
OS Loader
EFI Firmware
USB Keyboard
Simple_text_in
USB Driver
Legacy Free
OS Loader
EFI Firmware
Driver
PC-AT KBD
USB thunk
Legacy BIOS
Keyboard
Simple_text_in
Initial implementation
Simplified
design
Simplified
design

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?: Services and Protocols
What is EFI?: Services and Protocols
OS Loader
EFI Firmware
USB Keyboard
Simple_text_in
USB Driver
Legacy Free
xxx Driver
xxx Keyboard
OS Loader
EFI Firmware
Driver
PC-AT KBD
USB thunk
Legacy BIOS
Keyboard
Simple_text_in
Initial implementation
Simplified
design
Simplified
design

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?: Services and Protocols
What is EFI?: Services and Protocols
l l
Abstracted for flexibility
Abstracted for flexibility
l l
Support options
Support options
u u
Local head
Local head
Character based Character based
Graphical (not implemented yet) Graphical (not implemented yet)
u u
Remote head
Remote head
Serial link Serial link
Network Network
Implementation choices
Implementation choices

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?
What is EFI?
l l

G
G
uaranteed
uaranteed
U
U
nique
nique
Id
Id
entity
entity
u u
128
128
-
-
bit quantity defined by WfM 2.0 spec
bit quantity defined by WfM 2.0 spec
l l
Polices extensibility mechanism
Polices extensibility mechanism
l l
Allows publishing of new capabilities
Allows publishing of new capabilities
u u
GUID
GUID
u u
Interfaces
Interfaces
Safe co-existence of
3rd party extensions
Safe co-existence of
3rd party extensions

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
What is EFI?
What is EFI?
l l
Application
Application
u u
OS Loader
OS Loader
-
-
EFI application that takes
EFI application that takes
final control
final control
u u
Diagnostics
Diagnostics
u u
Recovery tools
Recovery tools
u u
Customer support apps
Customer support apps
l l
Driver
Driver
u u
Boot support for add
Boot support for add
-
-
ins
ins
u u
Code modules
Code modules
e.g. downloadable workarounds e.g. downloadable workarounds
Differentiation
opportunity

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Boot manager updated in Chapter 17
Boot manager updated in Chapter 17
uMinor changes to default behavior
uShorthand for hard drive device paths
uBoot option environment variable format extended
uMay affect OEM Boot Manager customization
l l
General bug fixes and clarifications
General bug fixes and clarifications
Changes to match customer feedback
Changes to match customer feedback

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Functionally replaces Legacy BBS
Functionally replaces Legacy BBS
l l
Order of processing load options
Order of processing load options
u uDriver order options Driver order options
load any drivers specified in Driver option list load any drivers specified in Driver option list
u uCheck Boot Next feature Check Boot Next feature
This feature is for OS setup so that on next boot this This feature is for OS setup so that on next boot this
option is selected once and then removed from the list option is selected once and then removed from the list
u uBoot option list Boot option list
see next slide for example case of options stored in see next slide for example case of options stored in
NVRAM with boot maintenance menu. NVRAM with boot maintenance menu.

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
failure
timeout
Boot
option 1
EFI OS
Loader
EFI SYSTEM
PARTITION
Boot
option 2
failure
failure
Boot
option 3
s
e
r
v
e
r
OS BOOT
LOADER
BOOTIA64.EFI
Boot diagnostic
Boot option 4
LAN

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l The only interface the end user should see The only interface the end user should see
l l Executes policy for ordering of EFI boot devices Executes policy for ordering of EFI boot devices
l l Example boot manager in EFI core source on Example boot manager in EFI core source on
website website
l l Uses EFI variables to store paths and boot order Uses EFI variables to store paths and boot order
l l OEM should customize boot manager for look and OEM should customize boot manager for look and
feel as well as security feel as well as security
l l For production boot straight to the OS For production boot straight to the OS
u udo not need to use built in Shell or startup. do not need to use built in Shell or startup.nsh nsh

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
How to specify where the
How to specify where the
os
os
loader is
loader is
u u
Utilize full EFI device path to boot device
Utilize full EFI device path to boot device
E.g. ACPI E.g. ACPI - - PCI PCI - - SCSI SCSI - - partition(SIG) partition(SIG) Filename Filename
E.g. ACPI E.g. ACPI - - PCI PCI - - MAC(MAC address) MAC(MAC address)
u u
Hard disk
Hard disk
short path option which only consists of partition short path option which only consists of partition
ID and filename or: ID and filename or:
GPT version is safer since it is unique. GPT version is safer since it is unique.
u u
Removable media (CDROM and LS120)
Removable media (CDROM and LS120)
\ \EFI EFI\ \BOOT BOOT\ \BOOTIA64.EFI or BOOTIA32.EFI BOOTIA64.EFI or BOOTIA32.EFI

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
A
P
I













SAL
EFI
IA64 OS
Legacy OS:
DOS, NT 4.0,
PAL
Boot Manager
IA-32
IA-64
A
P
I
A
P
I
Legacy BIOS

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
EFI services not available at runtime
EFI services not available at runtime
l l
No SAL or PAL API available
No SAL or PAL API available
l l
Only services available are Legacy IA
Only services available are Legacy IA
-
-
32
32
BIOS
BIOS
l l
DOS tests will not test
DOS tests will not test
Itanium
Itanium
Platform
Platform
Migrate Legacy Preboot Apps to EFI
Migrate Legacy Preboot Apps to EFI

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Industry Intercept on IA
Industry Intercept on IA
-
-
64
64
u u Intel POR is to use EFI starting at power Intel POR is to use EFI starting at power- -on on
u u AMI and Phoenix implementing EFI AMI and Phoenix implementing EFI
u u OEMs platforms supporting EFI OEMs platforms supporting EFI
u u IA IA- -64 operating systems being developed with EFI 64 operating systems being developed with EFI
IBM/Monterey, Linux, Novell, SCO, Solaris, Windows NT IBM/Monterey, Linux, Novell, SCO, Solaris, Windows NT
l l
IA
IA
-
-
32 intercept timing less clear, but:
32 intercept timing less clear, but:
u u EFI being implemented for embedded systems EFI being implemented for embedded systems
u u Manufacturing/test infrastructure moving to EFI Manufacturing/test infrastructure moving to EFI
Industry momentum
Industry momentum

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
EFI is a key component in DIG64
EFI is a key component in DIG64
u u
Enables migration away from legacy
Enables migration away from legacy
l l
UNIX Design Guide
UNIX Design Guide
u u
Additional implementation requirements
Additional implementation requirements
Foundation for system design
Foundation for system design

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Complete sample implementation of EFI
Complete sample implementation of EFI
u u Architecture neutral, IA Architecture neutral, IA- -32 and IA 32 and IA- -64 builds 64 builds
u u Code, build tools and documentation Code, build tools and documentation
EFI core interface implementation EFI core interface implementation
EFI library routines EFI library routines
EFI developers guide EFI developers guide
Sample drivers Sample drivers
l l
Readily available
Readily available
u uSimple shrink Simple shrink- -wrap license, downloadable code wrap license, downloadable code
Low barrier to adoption
Low barrier to adoption

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
EFI Application Toolkit
EFI Application Toolkit
u u Architecture neutral, IA Architecture neutral, IA- -32 and IA 32 and IA- -64 builds 64 builds
u u Code, build tools and documentation Code, build tools and documentation
EFI Shell and applications EFI Shell and applications
Standard library ported from Standard library ported from FreeBSD FreeBSD
libc, libsocket, libm
Complete network stack and utilities Complete network stack and utilities
Python scripting support Python scripting support
Unix style HTML manual pages Unix style HTML manual pages
l l
Readily available
Readily available
u uSimple shrink Simple shrink- -wrap license, downloadable code wrap license, downloadable code
Low barrier to adoption
Low barrier to adoption

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Intel EFI website
Intel EFI website
u u
http://developer.
http://developer.
intel
intel
.com/technology/EFI
.com/technology/EFI
u u
feedback form on website
feedback form on website
u u
register with EFI mailing list on website
register with EFI mailing list on website
l l
Intel SDV customer Quad support
Intel SDV customer Quad support
http://support. http://support.intel intel.com/support/go/ .com/support/go/ItaniumSDV ItaniumSDV
http://premier. http://premier.intel intel.com/ .com/
l l
IA
IA
-
-
64
64
Itanium
Itanium
software Area
software Area
u uhttp://developer. http://developer.intel intel.com/design/servers/ .com/design/servers/softdev softdev/ia64. /ia64.htm htm

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Lan
Lan
Boot
Boot
u u
PXE/UNDI located on WFM website
PXE/UNDI located on WFM website
PDK include DLLs for NT4 server PDK include DLLs for NT4 server
Lan Lan PXE/UNDI option PXE/UNDI option rom rom image and kit image and kit
u uhttp://developer. http://developer.intel intel.com/ .com/ial ial/ /wfm wfm/index. /index.htm htm

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Download the spec
Download the spec
l l developer. developer.intel intel.com .com\ \technology technology\ \efi efi
l l
Read it; send feedback
Read it; send feedback
l l
Contribute to Toolkit
Contribute to Toolkit
l l
The only way to boot on IA
The only way to boot on IA
-
-
64
64
is with EFI
is with EFI
u u EFI aware operating system EFI aware operating system
loaders loaders
u u EFI conformant platform firmware EFI conformant platform firmware
u u Pre Pre- -boot EFI applications boot EFI applications
l l
migrate tests to EFI
migrate tests to EFI
applications
applications
OEM
OSV
IBV

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Specification websites
Specification websites
l l
EDD 3.0 spec draft 4
EDD 3.0 spec draft 4 - - http://T13.org http://T13.org
uftp://fission.dt.wdc.com/pub/standards/x3t13/project/d1386r4.pdf
l l
EFI FAT32 Specification (see below)
EFI FAT32 Specification (see below)
l l
PE/COFF Image Format Specification
PE/COFF Image Format Specification
u u http://www. http://www.microsoft microsoft.com/ .com/hwdev hwdev/specs /specs
l l
Intel MSL SAL Specification
Intel MSL SAL Specification
u u http://developer. http://developer.intel intel.com/design/IA .com/design/IA- -64/Downloads/24535901. 64/Downloads/24535901.pdf pdf
l l
Developer Interface Guide for IA64
Developer Interface Guide for IA64
u u http://www.developer. http://www.developer.intel intel.com/design/servers/dev_guides .com/design/servers/dev_guides

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Overview
Overview
l l
Documentation
Documentation
l l
Shell and Boot Manager
Shell and Boot Manager
l l
Directory Structure
Directory Structure
l l
Development Environments
Development Environments
l l
EFI Application Toolkit Overview
EFI Application Toolkit Overview
l l
Sample Applications
Sample Applications
l l
EFI/SAL Integration
EFI/SAL Integration
l l
Open Lab
Open Lab

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l Must match spec revision with toolkit and sample Must match spec revision with toolkit and sample
implementation build (especially c library). implementation build (especially c library).
l l 0.92 spec matches 0.92. 0.92 spec matches 0.92.maj maj.min sample code reference .min sample code reference
implementation (92.10.8) and toolkit revision 0.72 implementation (92.10.8) and toolkit revision 0.72
l l 0.99 spec matches 0.99. 0.99 spec matches 0.99.maj maj.min sample code reference .min sample code reference
implementation (.99.12.20) and toolkit revision 0.8 implementation (.99.12.20) and toolkit revision 0.8
l l Lion bios 40 Lion bios 40- -62 0.99.12.21 EFI (use 0.8 toolkit) 62 0.99.12.21 EFI (use 0.8 toolkit)
l l Lion bios 63> 0.9912.31 EFI (use 0.9 toolkit) Lion bios 63> 0.9912.31 EFI (use 0.9 toolkit)
l l Big Big Sur Sur Bios 45 Bios 45- -76 has 0.99.12.20 EFI (use 0.8 toolkit) 76 has 0.99.12.20 EFI (use 0.8 toolkit)
l l Big Big Sur Sur Bios 77.. Has 0.99.12.31 EFI (use 0.9 toolkit) Bios 77.. Has 0.99.12.31 EFI (use 0.9 toolkit)

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
EFI Specification 0.99
EFI Specification 0.99
u uhttp://developer. http://developer.intel intel.com/technology/ .com/technology/efi efi
l l
EFI Sample Implementation 0.99.12.20
EFI Sample Implementation 0.99.12.20
u uhttp://developer. http://developer.intel intel.com/technology/ .com/technology/efi efi
l l
EFI Developers Guide
EFI Developers Guide
u uefi efi\ \notes notes\ \EFI_DG.DOC EFI_DG.DOC
l l
EFI Library Specification
EFI Library Specification
u uefi efi\ \notes notes\ \EFI_LIB.DOC EFI_LIB.DOC
l l
EFI Release Notes
EFI Release Notes
u uefi efi\ \notes notes\ \RELNOTE.DOC RELNOTE.DOC

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Boot time services
Boot time services
l l
Run time services
Run time services
l l
Protocols
Protocols
l l
File System Format
File System Format
u u
Legacy Partitioning Scheme
Legacy Partitioning Scheme
u u
New Partitioning Scheme
New Partitioning Scheme
l l
PCI Expansion ROMs
PCI Expansion ROMs

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
DEVICE_PATH DEVICE_PATH
DEVICE_IO DEVICE_IO
SIMPLE_INPUT_INTERFACE SIMPLE_INPUT_INTERFACE
SIMPLE_TEXT_OUTPUT_INTERFACE SIMPLE_TEXT_OUTPUT_INTERFACE
BLOCK_IO BLOCK_IO
DISK_IO DISK_IO
SIMPLE_FILE_SYSTEM SIMPLE_FILE_SYSTEM
LOAD_FILE LOAD_FILE
SERIAL_IO SERIAL_IO
UNICODE_COLLATION UNICODE_COLLATION
PXE_BC PXE_BC
SIMPLE_NETWORK SIMPLE_NETWORK

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
EFI Shell Commands
EFI Shell Commands
l l
Writing EFI Shell Commands *
Writing EFI Shell Commands *
l l
Writing EFI Applications *
Writing EFI Applications *
l l
Writing EFI OS Loaders *
Writing EFI OS Loaders *
l l
Function Summary
Function Summary
Boot Time Service Functions Boot Time Service Functions
Run Time Service Functions Run Time Service Functions
Protocol Functions Protocol Functions
Library Functions Library Functions
* Material is out of date. Updates will be released soon. * Material is out of date. Updates will be released soon.

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Initialization Functions Initialization Functions
Linked List Support Macros Linked List Support Macros
String Functions String Functions
Memory Support Functions Memory Support Functions
CRC Support Functions CRC Support Functions
Text I/O Functions Text I/O Functions
Math Functions Math Functions
Spin Lock Functions Spin Lock Functions
Handle and Protocol Support Functions Handle and Protocol Support Functions
File I/O Support Functions File I/O Support Functions
Device Path Support Functions Device Path Support Functions
Miscellaneous Functions and Macros Miscellaneous Functions and Macros

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
EFI shell
EFI shell
l l
Common Utilities
Common Utilities
l l
Libc
Libc
l l
Network Stack
Network Stack
l l
Multiple Processor Test Support
Multiple Processor Test Support
l l
Platform Management
Platform Management
l l
Security Service
Security Service
Useful tools for EFI
application development
Useful tools for EFI
application development
Source is
Available on
Website

O
S
L
o
a
d
e
r
H
a
r
d
w
a
r
e
B
I
O
S
E
F
I
C o m p a t i b i l i t y
H
a
r
d
w
a
r
e
EFI Shell
Utilities
Libc
Network
MP Test
Management
Security

O
S
L
o
a
d
e
r
H
a
r
d
w
a
r
e
B
I
O
S
E
F
I
C o m p a t i b i l i t y
H
a
r
d
w
a
r
e
EFI Shell
Utilities
Libc
Network
MP Test
Management
Security
E
F
I

A
P
I
E
F
I

A
P
I
E
F
I

A
P
I

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Toolkit Components
Toolkit Components
lCore utilities
u u
cp,
cp,
rm
rm
,
,
mkdir
mkdir
, type, ..
, type, ..
lExtended utilities
u u
Network utilities
Network utilities
FTP client and server, ping FTP client and server, ping
u u
Text editor
Text editor
lScripting interpreter (Python)

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Toolkit Components
Toolkit Components
lSMBIOS Interface
u u
Library routines for parsing SMBIOS
Library routines for parsing SMBIOS
tables
tables
lIPMI 1.0 Interface
u u
EFI protocol for sending and receiving
EFI protocol for sending and receiving
IPMI messages
IPMI messages

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Toolkit Components
Toolkit Components
lPort of FreeBSD TCP/IP stack
lSupports standard protocols
u u
IPv4, ICMP, ARP, UDP, TCP
IPv4, ICMP, ARP, UDP, TCP
lSocket library interface
lImplemented as an EFI protocol
Network functionality in FW
Network functionality in FW

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Toolkit Components Toolkit Components
l Limited but extensible platform security
u uService that application may choose to use Service that application may choose to use
u uCommon security interface Common security interface
u uCustomizable security policies Customizable security policies
l Provide reference implementation
u uUnix style password file Unix style password file
u uOne One- -way encryption way encryption
Given user and password.. is this user Given user and password.. is this user
authenticated ? authenticated ?
Rudimentary application security
Rudimentary application security

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l Similar to KD for NT or GDB for Linux Similar to KD for NT or GDB for Linux
l l Source disassembly Source disassembly
l l Uses serial port from another IA32 PC Uses serial port from another IA32 PC
l l Enable debugging Enable debugging
u uEFI applications, drivers, and protocols EFI applications, drivers, and protocols
l l Intel compiler support Intel compiler support
l l Available as part of Toolkit Available as part of Toolkit

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Without debugger utilize Error Console
Without debugger utilize Error Console
l l
Use Debug Macro to
Use Debug Macro to
printf
printf
errors/info
errors/info
l l
EFI global variable sets Error Console
EFI global variable sets Error Console
output (setup in boot manager)
output (setup in boot manager)
u u
to Serial port (logged on another pc)
to Serial port (logged on another pc)
u u
to Video Screen
to Video Screen

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Toolkit Components
Toolkit Components
EFI
app.
Debug
GUI

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Toolkit Components
Toolkit Components
EFI
app.
Debug
GUI
l Enable debugging
u uEFI applications, drivers, and protocols EFI applications, drivers, and protocols

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Toolkit Components
Toolkit Components
EFI
app.
Debug
GUI
l Enable debugging
u uEFI applications, drivers, and protocols EFI applications, drivers, and protocols
l User interface
u uProvided by commercial debugger Provided by commercial debugger
u uRequires debugger with remote debug Requires debugger with remote debug
capability capability

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Toolkit Components
Toolkit Components
EFI
app.
Debug
GUI
l Enable debugging
u uEFI applications, drivers, and protocols EFI applications, drivers, and protocols
l User interface
u uProvided by commercial debugger Provided by commercial debugger
u uRequires debugger with remote debug Requires debugger with remote debug
capability capability
l Toolkit agent
u uCan be customized for remote protocols Can be customized for remote protocols
u uIntel Enhanced Debugger (EDB) reference Intel Enhanced Debugger (EDB) reference
EDB is included in the IA EDB is included in the IA- -64 SDK 64 SDK

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Toolkit Components
Toolkit Components
EFI
app.
Debug
GUI
l Enable debugging
u uEFI applications, drivers, and protocols EFI applications, drivers, and protocols
l User interface
u uProvided by commercial debugger Provided by commercial debugger
u uRequires debugger with remote debug Requires debugger with remote debug
capability capability
l Toolkit agent
u uCan be customized for remote protocols Can be customized for remote protocols
u uIntel Enhanced Debugger (EDB) reference Intel Enhanced Debugger (EDB) reference
EDB is included in the IA EDB is included in the IA- -64 SDK 64 SDK
Firmware source debug
Firmware source debug

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Toolkit adopters are free to make
Toolkit adopters are free to make
source code changes
source code changes
u uThere are no restrictions on differentiation There are no restrictions on differentiation
l l
Collaboration
Collaboration
u uWe will incorporate changes that are voluntarily We will incorporate changes that are voluntarily
returned and benefit industry as a whole returned and benefit industry as a whole
u uLooking for submissions: SCSI protocol, ASPI Looking for submissions: SCSI protocol, ASPI
protocol, protocol,

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Still uses legacy IA32 option
Still uses legacy IA32 option
rom
rom
code
code
l l
No illegal assembly instructions for x86
No illegal assembly instructions for x86
environment as defined in SAL specification
environment as defined in SAL specification
l l
EDD 3.0 draft 4 requirement for all plug in
EDD 3.0 draft 4 requirement for all plug in
card option
card option
roms
roms
l l
Only effects plug in cards with boot devices
Only effects plug in cards with boot devices
l l
Determine if in IA64 platform with _FIT_
Determine if in IA64 platform with _FIT_
l l
Migrate option
Migrate option
rom
rom
setup programs to EFI
setup programs to EFI
applications
applications

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
EFI
SAL
Legacy BIOS
Option ROM
Boot manager
EFI TESTS
OS PARTITION
EFI OS
Loader
EFI SYSTEM
PARTITION
IHV
OEM MFG
OEM MFG
EFI Shell
EFI Driver

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Overview
Overview
l l
Documentation
Documentation
l l
Shell and Boot Manager
Shell and Boot Manager
l l
Directory Structure
Directory Structure
l l
Development Environments
Development Environments
l l
EFI Application Toolkit Overview
EFI Application Toolkit Overview
l l
Sample Applications
Sample Applications
l l
EFI/SAL Integration
EFI/SAL Integration
l l
Open Lab
Open Lab

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l
l
l
l
l
l
l
l
l
l
l
l
l
l

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
help
help
l l
dh
dh
l l
map
map
l l
guid
guid
l l
alias
alias
l l
set
set
l l
exit
exit
l l
cd
cd

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Shell>help Shell>help
help [internal command] help [internal command] - - Displays this help Displays this help
guid guid [ [sname sname] ] - - Dump known Dump known guid guid ids ids
set [ set [- -d] [ d] [sname sname] [value] ] [value] - - Set/get environment variable Set/get environment variable
alias [ alias [- -d] [ d] [sname sname] [value] ] [value] - - Set/get alias settings Set/get alias settings
dh [ dh [- -p p prot prot_id] | [handle] _id] | [handle] - - Dump handle info Dump handle info
map [ map [- -dvr dvr] [ ] [sname sname[:]] [handle] [:]] [handle] - - Map Map shortname shortname to device path to device path
cd cd [path] [path] - - Updates the current directory Updates the current directory
echo [[ echo [[- -on | on | - -off] | [text] off] | [text] - - Echo text to Echo text to stdout stdout or toggle script echo or toggle script echo
if [not] condition then if [not] condition then - - Script Script- -only: Condition is "string1 == string2" only: Condition is "string1 == string2"
or "exist file" or "exist file"
endif endif - - Script Script- -only: Terminate effect of if command only: Terminate effect of if command
goto goto label label - - Script Script- -only: Jump to label location in script only: Jump to label location in script
for for var var in <set> in <set> - - Script Script- -only: loop construct only: loop construct
endfor endfor - - Script Script- -only: delimiter for loop construct only: delimiter for loop construct
pause pause - - Script Script- -only: prompt to quit or continue only: prompt to quit or continue

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
dh [ dh [- -p prot_id] | [handle] p prot_id] | [handle]
[ [- -p prot_id] p prot_id] Protocol to dump Protocol to dump
[handle] [handle] Handle number to dump Handle number to dump
Shell> dh Shell> dh
1: varstore 1: varstore
2: varstore 2: varstore
3: Image(dskio) 3: Image(dskio)
4: Image(pblkio) 4: Image(pblkio)
5: Image(fat) 5: Image(fat)
6: DevIo DevPath() 6: DevIo DevPath()
7: unicode 7: unicode
8: txtin DevPath(..,0)/Pci(0|0)/Acpi(PNP0303,0)) 8: txtin DevPath(..,0)/Pci(0|0)/Acpi(PNP0303,0))
9: txtout DevPath(Acpi(PNP0A03,0)/Pci(3|0)) 9: txtout DevPath(Acpi(PNP0A03,0)/Pci(3|0))
A: diskio blkio fs DevPath(..,0)/Pci(0|0)/Acpi(PNP0604,0)) A: diskio blkio fs DevPath(..,0)/Pci(0|0)/Acpi(PNP0604,0))
B: diskio blkio DevPath(VenHw(Unknown Device:80)) B: diskio blkio DevPath(VenHw(Unknown Device:80))
... ...

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Shell> dh Shell> dh p fs p fs
A: diskio blkio fs DevPath(..,0)/Pci(0|0)/Acpi(PNP0604,0)) A: diskio blkio fs DevPath(..,0)/Pci(0|0)/Acpi(PNP0604,0))
C: diskio blkio fs DevPath(..vice:80)/HD(Part1,Sig1 C: diskio blkio fs DevPath(..vice:80)/HD(Part1,Sig1- -F4A3)) F4A3))
E: diskio blkio fs DevPath(..,Sig1 E: diskio blkio fs DevPath(..,Sig1- -F4A3)/HD(Part1,Sig1 F4A3)/HD(Part1,Sig1- -0)) 0))
10: diskio blkio fs DevPath(..rt2,Sig1 10: diskio blkio fs DevPath(..rt2,Sig1- -0)/HD(Part1,Sig1 0)/HD(Part1,Sig1- -0)) 0))
Shell> dh A Shell> dh A
Handle 0A (07FC6E08) Handle 0A (07FC6E08)
diskio diskio
blkio Fixed MId:1 bsize 200, lblock B40 (1,474,560), raw rw c blkio Fixed MId:1 bsize 200, lblock B40 (1,474,560), raw rw cached fs ached fs
dpath dpath
PNP Device Path for PnP PNP Device Path for PnP
HID A0341D0, UID 0 HID A0341D0, UID 0
Hardware Device Path for PCI Hardware Device Path for PCI
PNP Device Path for PnP PNP Device Path for PnP
HID 60441D0, UID 0 HID 60441D0, UID 0
AsStr: 'Acpi(PNP0A03,0)/Pci(0|0)/Acpi(PNP0604,0)' AsStr: 'Acpi(PNP0A03,0)/Pci(0|0)/Acpi(PNP0604,0)'

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
map [ map [- -dvr] [sname] [handle] dvr] [sname] [handle]
[ [- -d] d] Delete a mapping Delete a mapping
[ [- -v] v] Verbose listing of mappings Verbose listing of mappings
[ [- -r] Regenerate default mappings r] Regenerate default mappings
[sname] [sname] A user defined name for the mapping A user defined name for the mapping
Can use to include white space Can use to include white space
[handle] [handle] The handle number from the dh command The handle number from the dh command
Shell> map Shell> map
Device mapping table Device mapping table
fs0 : Acpi(PNP0A03,0)/Pci(0|0)/Acpi(PNP0604,0) fs0 : Acpi(PNP0A03,0)/Pci(0|0)/Acpi(PNP0604,0)
blk0 : Acpi(PNP0A03,0)/Pci(0|0)/Acpi(PNP0604,0) blk0 : Acpi(PNP0A03,0)/Pci(0|0)/Acpi(PNP0604,0)
blk1 : VenHw(Unknown Device:80) blk1 : VenHw(Unknown Device:80)
blk2 : VenHw(Unknown Device:80)/HD(Part1,Sig1 blk2 : VenHw(Unknown Device:80)/HD(Part1,Sig1- -B3C8) B3C8)
fs1 : VenHw(Unknown Device:80)/HD(Part1,Sig1 fs1 : VenHw(Unknown Device:80)/HD(Part1,Sig1- -F4A3) F4A3)

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Shell> map D C Shell> map D C
Shell> map Shell> map
Device mapping table Device mapping table
fs0 : Acpi(PNP0A03,0)/Pci(0|0)/Acpi(PNP0604,0) fs0 : Acpi(PNP0A03,0)/Pci(0|0)/Acpi(PNP0604,0)
blk0 : Acpi(PNP0A03,0)/Pci(0|0)/Acpi(PNP0604,0) blk0 : Acpi(PNP0A03,0)/Pci(0|0)/Acpi(PNP0604,0)
blk1 : VenHw(Unknown Device:80) blk1 : VenHw(Unknown Device:80)
blk2 : VenHw(Unknown Device:80)/HD(Part1,Sig1 blk2 : VenHw(Unknown Device:80)/HD(Part1,Sig1- -B3C8) B3C8)
fs1 : VenHw(Unknown Device:80)/HD(Part1,Sig1 fs1 : VenHw(Unknown Device:80)/HD(Part1,Sig1- -F4A3) F4A3)
D : VenHw(Unknown Device:80)/HD(Part1,Sig1 D : VenHw(Unknown Device:80)/HD(Part1,Sig1- -F4A3) F4A3)
Shell> map Shell> map v D v D
D : VenHw(Unknown Device:80)/HD(Part1,Sig1 D : VenHw(Unknown Device:80)/HD(Part1,Sig1- -F4A3) F4A3)
= Handle C: diskio blkio fs = Handle C: diskio blkio fs
> > \ \
Shell> map Shell> map d D d D

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Shell> guid Shell> guid
DevIo : AF6AC311 DevIo : AF6AC311- -84C3 84C3- -11D2 11D2- -8E3C 8E3C- -00A0C969723B 00A0C969723B
diskio : CE345171 diskio : CE345171- -BA0B BA0B- -11D2 11D2- -8E4F 8E4F- -00A0C969723B 00A0C969723B
blkio : 964E5B21 blkio : 964E5B21- -6459 6459- -11D2 11D2- -8E39 8E39- -00A0C969723B * 00A0C969723B *
txtin : 387477C1 txtin : 387477C1- -69C7 69C7- -11D2 11D2- -8E39 8E39- -00A0C969723B 00A0C969723B
txtout : 387477C2 txtout : 387477C2- -69C7 69C7- -11D2 11D2- -8E39 8E39- -00A0C969723B * 00A0C969723B *
fs : 964E5B22 fs : 964E5B22- -6459 6459- -11D2 11D2- -8E39 8E39- -00A0C969723B 00A0C969723B
load : 56EC3091 load : 56EC3091- -954C 954C- -11D2 11D2- -8E3F 8E3F- -00A0C969723B 00A0C969723B
image : 5B1B31A1 image : 5B1B31A1- -9562 9562- -11D2 11D2- -8E3F 8E3F- -00A0C969723B * 00A0C969723B *
varstore : F088CD91 varstore : F088CD91- -A046 A046- -11D2 11D2- -8E42 8E42- -00A0C969723B 00A0C969723B
dpath : 09576E91 dpath : 09576E91- -6D3F 6D3F- -11D2 11D2- -8E39 8E39- -00A0C969723B * 00A0C969723B *
unicode : 1D85CD7F unicode : 1D85CD7F- -F43D F43D- -11D2 11D2- -9A0C 9A0C- -0090273FC14D 0090273FC14D
pxe : 01949C4C pxe : 01949C4C- -9496 9496- -11D2 11D2- -85E1 85E1- -00A0C93EC93B 00A0C93EC93B
ShellInt : 47C7B223 ShellInt : 47C7B223- -C42A C42A- -11D2 11D2- -8E57 8E57- -00A0C969723B 00A0C969723B
SEnv : 47C7B224 SEnv : 47C7B224- -C42A C42A- -11D2 11D2- -8E57 8E57- -00A0C969723B 00A0C969723B
ShellProtId : 47C7B226 ShellProtId : 47C7B226- -C42A C42A- -11D2 11D2- -8E57 8E57- -00A0C969723B 00A0C969723B
ShellDevPathMap : 47C7B225 ShellDevPathMap : 47C7B225- -C42A C42A- -11D2 11D2- -8E57 8E57- -00A0C969723B 00A0C969723B
ShellAlias : 47C7B227 ShellAlias : 47C7B227- -C42A C42A- -11D2 11D2- -8E57 8E57- -00A0C969723B 00A0C969723B
G0 : 00000000 G0 : 00000000- -0000 0000- -0000 0000- -0000 0000- -000000000000 000000000000
Efi : 8BE4DF61 Efi : 8BE4DF61- -93CA 93CA- -11D2 11D2- -AA0D AA0D- -00E098032B8C 00E098032B8C
GenFileInfo : 09576E92 GenFileInfo : 09576E92- -6D3F 6D3F- -11D2 11D2- -8E39 8E39- -00A0C969723B 00A0C969723B
FileSysInfo : 09576E93 FileSysInfo : 09576E93- -6D3F 6D3F- -11D2 11D2- -8E39 8E39- -00A0C969723B 00A0C969723B
PcAnsi : E0C14753 PcAnsi : E0C14753- -F9BE F9BE- -11D2 11D2- -9A0C 9A0C- -0090273FC14D 0090273FC14D
Unknown Device : CF31FAC5 Unknown Device : CF31FAC5- -C24E C24E- -11D2 11D2- -85F3 85F3- -00A0C93EC93B 00A0C93EC93B
g1 : 43D66E51 g1 : 43D66E51- -AD78 AD78- -11D2 11D2- -8E4B 8E4B- -00A0C969723B 00A0C969723B
g2 : 386F4BBC g2 : 386F4BBC- -7782 7782- -11D2 11D2- -85D6 85D6- -00A0C93EC93B 00A0C93EC93B
g3 : EFE309D1 g3 : EFE309D1- -ACA9 ACA9- -11D2 11D2- -85E2 85E2- -00A0C93EC93B 00A0C93EC93B

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
alias [ alias [- -d] [sname] [value] d] [sname] [value]
[ [- -d] d] Delete the alias Delete the alias
[sname] [sname] Alias name Alias name
Can use to include white space Can use to include white space
[value] [value] EFI command or EFI application EFI command or EFI application
Shell> alias Shell> alias
dir : ls dir : ls
md : mkdir md : mkdir
rd : rm rd : rm
del : rm del : rm
copy : cp copy : cp
Shell> alias myguid guid Shell> alias myguid guid
Shell> alias Shell> alias d myguid d myguid
Note : Recursion is not supported Note : Recursion is not supported

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
set [ set [- -d] [sname] [value] d] [sname] [value]
[ [- -d] d] Delete the environment variable Delete the environment variable
[sname] [sname] Environment variable name Environment variable name
Can use to include white space Can use to include white space
[value] [value] Environment variable value Environment variable value
Can use to include white space Can use to include white space
Shell> set Shell> set
path : fs0: path : fs0:\ \efi efi\ \tools;fs0: tools;fs0:\ \;. ;.
Shell> set DiagnosticPath fs0: Shell> set DiagnosticPath fs0:\ \efi efi\ \diag diag
Shell> set Shell> set
path : fs0: path : fs0:\ \efi efi\ \tools;fs0: tools;fs0:\ \;. ;.
DiagnosticPath : fs0: DiagnosticPath : fs0:\ \efi efi\ \diag diag

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Shell> set Shell> set d DiagnosticPath d DiagnosticPath
Shell> set Shell> set
path : fs0: path : fs0:\ \efi efi\ \tools;fs0: tools;fs0:\ \;. ;.
Shell> set This String This is a string Shell> set This String This is a string
Shell> set Shell> set
path : fs0: path : fs0:\ \efi efi\ \tools;fs0: tools;fs0:\ \;. ;.
This String : This is a string This String : This is a string
Shell> set path Shell> set path
path : fs0: path : fs0:\ \efi efi\ \tools;fs0: tools;fs0:\ \;. ;.
Shell> set Shell> set d This String d This String

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Returns control to the EFI Application that
Returns control to the EFI Application that
launched the EFI Shell
launched the EFI Shell
u uCould be the EFI Boot Manager Could be the EFI Boot Manager
u uCould be another copy of the EFI Shell Could be another copy of the EFI Shell

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Changes the current working directory
Changes the current working directory
l l
Syntax similar to DOS CD command
Syntax similar to DOS CD command

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
ls
ls
l l
mkdir
mkdir
l l
cp
cp
l l
rm
rm
l l
type
type
l l
load
load
l l
nshell
nshell
l l
memmap
memmap
l l
mode
mode
l l
ver
ver
l l
date
date
l l
time
time

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Displays a directory on the display
Displays a directory on the display
l l
Syntax similar to DOS DIR command
Syntax similar to DOS DIR command

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Creates a new subdirectory
Creates a new subdirectory
l l
Syntax similar to the DOS MKDIR command
Syntax similar to the DOS MKDIR command

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Copies one or more files from one directory
Copies one or more files from one directory
to another
to another
l l
Syntax similar to the DOS COPY command
Syntax similar to the DOS COPY command

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Removes one or more files or directories
Removes one or more files or directories
l l
Syntax similar to DOS DEL command
Syntax similar to DOS DEL command
l l
Syntax similar to DOS RMDIR command
Syntax similar to DOS RMDIR command

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
type [ type [- -a] file a] file
[ [- -a] a] Display the file as ASCII characters. Display the file as ASCII characters.
l l
Send the contents of a file to the display
Send the contents of a file to the display
l l
Supports both ASCII and UNICODE files
Supports both ASCII and UNICODE files
l l
Syntax similar to DOS TYPE command
Syntax similar to DOS TYPE command

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
load file load file
l l
Loads an EFI driver
Loads an EFI driver

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
nshell nshell
l l
Launches another copy of the EFI Shell
Launches another copy of the EFI Shell

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Shell> Shell>memmap memmap
Type Start End # Pages A Type Start End # Pages Attributes ttributes
available 00000000009C0000 available 00000000009C0000- -0000000001D51FFF 0000000000001392 0000000000000008 0000000001D51FFF 0000000000001392 0000000000000008
LoaderData LoaderData 0000000001D52000 0000000001D52000- -0000000001D52FFF 0000000000000001 0000000000000008 0000000001D52FFF 0000000000000001 0000000000000008
BS_data 0000000001D53000 BS_data 0000000001D53000- -0000000001D63FFF 0000000000000011 0000000000000008 0000000001D63FFF 0000000000000011 0000000000000008
LoaderData LoaderData 0000000001D64000 0000000001D64000- -0000000001D64FFF 0000000000000001 0000000000000008 0000000001D64FFF 0000000000000001 0000000000000008
BS_data 0000000001D65000 BS_data 0000000001D65000- -0000000001D66FFF 0000000000000002 0000000000000008 0000000001D66FFF 0000000000000002 0000000000000008
LoaderData LoaderData 0000000001D67000 0000000001D67000- -0000000001D67FFF 0000000000000001 0000000000000008 0000000001D67FFF 0000000000000001 0000000000000008
LoaderCode LoaderCode 0000000001D68000 0000000001D68000- -0000000001D6EFFF 0000000000000007 0000000000000008 0000000001D6EFFF 0000000000000007 0000000000000008
LoaderData LoaderData 0000000001D6F000 0000000001D6F000- -0000000001D73FFF 0000000000000005 0000000000000008 0000000001D73FFF 0000000000000005 0000000000000008
BS_data 0000000001D74000 BS_data 0000000001D74000- -0000000001D7AFFF 0000000000000007 0000000000000008 0000000001D7AFFF 0000000000000007 0000000000000008
BS_code 0000000001D7B000 BS_code 0000000001D7B000- -0000000001D8EFFF 0000000000000014 0000000000000008 0000000001D8EFFF 0000000000000014 0000000000000008
BS_data 0000000001D8F000 BS_data 0000000001D8F000- -0000000001D97FFF 0000000000000009 0000000000000008 0000000001D97FFF 0000000000000009 0000000000000008
LoaderData LoaderData 0000000001D98000 0000000001D98000- -0000000001D98FFF 0000000000000001 0000000000000008 0000000001D98FFF 0000000000000001 0000000000000008
BS_data 0000000001D99000 BS_data 0000000001D99000- -0000000001D99FFF 0000000000000001 0000000000000008 0000000001D99FFF 0000000000000001 0000000000000008
LoaderData LoaderData 0000000001D9A000 0000000001D9A000- -0000000001D9AFFF 0000000000000001 0000000000000008 0000000001D9AFFF 0000000000000001 0000000000000008
LoaderCode LoaderCode 0000000001D9B000 0000000001D9B000- -0000000001DA3FFF 0000000000000009 0000000000000008 0000000001DA3FFF 0000000000000009 0000000000000008
LoaderData LoaderData 0000000001DA4000 0000000001DA4000- -0000000001DACFFF 0000000000000009 0000000000000008 0000000001DACFFF 0000000000000009 0000000000000008
BS_data 0000000001DAD000 BS_data 0000000001DAD000- -0000000001DB0FFF 0000000000000004 0000000000000008 0000000001DB0FFF 0000000000000004 0000000000000008
RT_data 0000000001DB1000 RT_data 0000000001DB1000- -0000000001DB9FFF 0000000000000009 8000000000000008 0000000001DB9FFF 0000000000000009 8000000000000008
BS_data 0000000001DBA000 BS_data 0000000001DBA000- -0000000001DBEFFF 0000000000000005 0000000000000008 0000000001DBEFFF 0000000000000005 0000000000000008
RT_data 0000000001DBF000 RT_data 0000000001DBF000- -0000000001DBFFFF 0000000000000001 8000000000000008 0000000001DBFFFF 0000000000000001 8000000000000008
LoaderCode LoaderCode: 16 pages (65,536) : 16 pages (65,536)
LoaderData LoaderData: 19 pages (77,824) : 19 pages (77,824)
BS_code : 20 pages (81,920) BS_code : 20 pages (81,920)
BS_data : 45 pages (184,320) BS_data : 45 pages (184,320)
RT_data : 10 pages (40,960) RT_data : 10 pages (40,960)
available : 5,010 pages (20,520,960) available : 5,010 pages (20,520,960)

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
mode [row col] mode [row col]
[row] [row] Number of rows on display Number of rows on display
[col] Number of columns on display [col] Number of columns on display
Shell> mode Shell> mode
Available modes on standard output Available modes on standard output
col 80 row 25 * col 80 row 25 *
col 80 row 50 col 80 row 50
col 80 row 43 col 80 row 43
col 100 row 100 col 100 row 100
col 100 row 999 col 100 row 999
Shell> mode 80 50 Shell> mode 80 50

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Shell> ver Shell> ver
EFI Specification Revision 0.92 EFI Specification Revision 0.92
EFI Vendor = INTEL EFI Vendor = INTEL
EFI Revision = 01192000 EFI Revision = 01192000

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
time [hh:mm:ss] time [hh:mm:ss]
[hh] Hours [hh] Hours
[mm] Minutes [mm] Minutes
[ss] Seconds [ss] Seconds
Shell> time Shell> time
17:32:02 17:32:02
Shell> time 17:30:00 Shell> time 17:30:00
Shell> time Shell> time
17:30:03 17:30:03
Shell> Shell>

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
date [hh:mm:ss] date [hh:mm:ss]
[mm] Month (1..12) [mm] Month (1..12)
[dd] Day (1..31) [dd] Day (1..31)
[yyyy] Year [yyyy] Year
Shell> date Shell> date
09/07/1999 09/07/1999
Shell> date 09/06/1999 Shell> date 09/06/1999
Shell> date Shell> date
09/06/1999 09/06/1999
Shell> Shell>

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
echo
echo
l l
pause
pause
l l
for /
for /
endfor
endfor
l l
if /
if /
endif
endif
l l
goto
goto
l l
startup.
startup.
nsh
nsh
(do not use for operating
(do not use for operating
system boot)
system boot)

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Syntax similar to DOS commands
Syntax similar to DOS commands
l l
*
*
Matches any string
Matches any string
l l
?
?
Matches any character
Matches any character
fs0:> dir *. fs0:> dir *.efi efi
fs0:> dir test?. fs0:> dir test?.efi efi

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Redirect standard output to a Unicode file
Redirect standard output to a Unicode file
memmap memmap 1> 1> Foo Foo.txt .txt
memmap memmap > > Foo Foo.txt .txt
Redirect standard output to an ASCII file
Redirect standard output to an ASCII file
memmap memmap 1>a 1>a Foo Foo.txt .txt
memmap memmap >a >a Foo Foo.txt .txt
l l
Redirect standard error to a Unicode file
Redirect standard error to a Unicode file
memmap memmap 2> 2> Foo Foo.txt .txt
l l
Redirect standard error to an ASCII file
Redirect standard error to an ASCII file
memmap memmap 2>a 2>a Foo Foo.txt .txt

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Enter application name at command prompt
Enter application name at command prompt
l l
EFI Shell uses path environment variable
EFI Shell uses path environment variable
l l
EFI Shell automatically adds .
EFI Shell automatically adds .
efi
efi


path = fs0:> path = fs0:>\ \efi efi\ \tools;fs0: tools;fs0:\ \;. ;.
fs0:> test. fs0:> test.efi efi
fs0:> test fs0:> test
fs1:> test fs1:> test

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Boot Option Maintenance Menu
Boot Option Maintenance Menu
u u
Add some default boot options
Add some default boot options
u u
Locate and add a specific boot image
Locate and add a specific boot image
u u
Launch an application
Launch an application
u u
Delete all boot options
Delete all boot options
l l
Select boot option
Select boot option

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
EFI Shell Exercises
EFI Shell Exercises
l l
EFI Development Environments
EFI Development Environments
l l
Sample EFI Applications
Sample EFI Applications
l l
Sample EFI Shell Applications
Sample EFI Shell Applications

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Overview
Overview
l l
Documentation
Documentation
l l
Shell and Boot Manager
Shell and Boot Manager
l l
Directory Structure
Directory Structure
l l
Development Environments
Development Environments
l l
EFI Application Toolkit Overview
EFI Application Toolkit Overview
l l
Sample Applications
Sample Applications
l l
EFI/SAL Integration
EFI/SAL Integration
l l
Open Lab
Open Lab

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
\
\
build
build
EFI Build tips
EFI Build tips
l l
\
\
corefw
corefw
EFI Source Code
EFI Source Code
l l
\
\
inc
inc
Main EFI Include Files
Main EFI Include Files
l l
\
\
lib
lib
EFI Library Source Code
EFI Library Source Code
l l
\
\
notes
notes
EFI Documentation
EFI Documentation

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Release Notes
Release Notes
u u
RELNOTE.DOC
RELNOTE.DOC
l l
EFI Developers Guide
EFI Developers Guide
u u
EFI_DG.DOC
EFI_DG.DOC
l l
EFI Library Specification
EFI Library Specification
u u
EFI_LIB.DOC
EFI_LIB.DOC
l l
\
\
samples
samples

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
\
\
nt32
nt32
WinNT Emulation
WinNT Emulation
l l
\
\
sal64
sal64
IA
IA
-
-
64
64
l l
\
\
bios32
bios32
IA
IA
-
-
32
32
l l
\
\
IA32
IA32
-
-
emb
emb
IA
IA
-
-
32
32
embbeded
embbeded
EFI native
EFI native
EFI drivers only
EFI drivers only

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
\
\
nt32
nt32
\
\
bin
bin
u u
Contains executable EFI image
Contains executable EFI image
l l
\
\
nt32
nt32
\
\
output
output
u u
Duplicates the EFI Directory Structure
Duplicates the EFI Directory Structure
u u
Contains all the OBJ and LIB files
Contains all the OBJ and LIB files

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
\
\
drivers
drivers
u u
\
\
drivers
drivers
\
\
ConSplitter
ConSplitter
u u
\
\
drivers
drivers
\
\
diskio
diskio
u u
\
\
drivers
drivers
\
\
fat
fat
u u
\
\
drivers
drivers
\
\
pblkio
pblkio
u u
\
\
drivers
drivers
\
\
ramdisk
ramdisk
l l
\
\
fw
fw
u u
\
\
fw
fw
\
\
efi
efi
u u
\
\
fw
fw
\
\
platform *
platform *

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
\
\
BuildTip
BuildTip
\
\
nt
nt
MainEntry MainEntry() for NT32 build tip () for NT32 build tip
l l
\
\
BuildTip
BuildTip
\
\
sal
sal
MainEntry MainEntry() for SAL64 () for SAL64
l l
\
\
BuildTip
BuildTip
\
\
bios32
bios32
MainEntry MainEntry() for BIOS32 () for BIOS32
l l
\
\
drivers
drivers
Native EFI Device Drivers Native EFI Device Drivers
l l
\
\
PlDriver
PlDriver
Platform specific drivers Platform specific drivers
l l
\
\
bootmgr
bootmgr

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
\
\
PlDriver
PlDriver
\
\
defio
defio
u uPCI I/O, Memory, PCI I/O, Memory, Config Config read/write routines read/write routines
l l
\
\
drivers
drivers
\
\
biosint
biosint
\
\
keyboard
keyboard
u uUse INT 0x16 calls to perform keyboard I/O Use INT 0x16 calls to perform keyboard I/O
l l
\
\
drivers
drivers
\
\
biosint
biosint
\
\
vga
vga
u uUse INT 0x10 calls to perform video I/O Use INT 0x10 calls to perform video I/O
l l
\
\
drivers
drivers
\
\
biosint
biosint
\
\
disk
disk
u uUse INT 0x13 calls to perform disk I/O Use INT 0x13 calls to perform disk I/O
l l
\
\
drivers
drivers
\
\
biosint
biosint
\
\
undi
undi
u uUses UNDI ROM to send/receive packets Uses UNDI ROM to send/receive packets

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Overview
Overview
l l
Documentation
Documentation
l l
Shell and Boot Manager
Shell and Boot Manager
l l
Directory Structure
Directory Structure
l l
Development Environments
Development Environments
l l
EFI Application Toolkit Overview
EFI Application Toolkit Overview
l l
Sample Applications
Sample Applications
l l
EFI/SAL Integration
EFI/SAL Integration
l l
Open Lab
Open Lab

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
\
\
nt32
nt32
WinNT Emulation
WinNT Emulation
l l
\
\
sal64
sal64
IA
IA
-
-
64
64
l l
\
\
bios32
bios32
IA
IA
-
-
32
32
l l
\
\
IA32
IA32
-
-
emb
emb
Embedded EFI for IA32 native
Embedded EFI for IA32 native
drivers only
drivers only

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
EFI Shell Exercises
EFI Shell Exercises
l l
EFI Development Environments
EFI Development Environments
l l
Sample EFI Applications
Sample EFI Applications
l l
Sample EFI Shell Applications
Sample EFI Shell Applications

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Overview
Overview
l l
Documentation
Documentation
l l
Shell and Boot Manager
Shell and Boot Manager
l l
Directory Structure
Directory Structure
l l
Development Environments
Development Environments
l l
EFI Application Toolkit Overview
EFI Application Toolkit Overview
l l
Sample Applications
Sample Applications
l l
EFI/SAL Integration
EFI/SAL Integration
l l
Open Lab
Open Lab

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Enable rapid application development
Enable rapid application development
l l
Create rich pre
Create rich pre
-
-
boot environment that
boot environment that
industry can count on
industry can count on
l l
Enable 3rd party markets
Enable 3rd party markets
l l
Allow industry contributions
Allow industry contributions
l l
Provide uniform environment between
Provide uniform environment between
IA
IA
-
-
32 and IA
32 and IA
-
-
64
64

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l Rich C library support Rich C library support
l l EFI Shell source and tools EFI Shell source and tools
l l Full screen editor Full screen editor
l l TCP/IP Network Stack and Utilities(ftp client/server TCP/IP Network Stack and Utilities(ftp client/server
and DHCP server) and DHCP server)
l l Python Scripting interpreter Python Scripting interpreter
l l Multiprocessor Test Support Multiprocessor Test Support
l l Compress/Decompress library Compress/Decompress library libz libz
l l C++ support Library C++ support Library
l l Platform Management ( Platform Management (smbios smbios and IPMI 1.0) and IPMI 1.0)
l l next revision next revision - - Security Services & Source Security Services & Source
debugger debugger

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Native EFI Model
Native EFI Model
u u
Uses only EFI constructs
Uses only EFI constructs
u u
Access to all EFI constructs
Access to all EFI constructs
u u
Smaller code size
Smaller code size
l l
Portability Model
Portability Model
u u
Familiar programming interfaces
Familiar programming interfaces
u u
Easier to port POSIX based programs
Easier to port POSIX based programs
u u
Larger binary image
Larger binary image
l l
A single program can use both
A single program can use both

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Native EFI support
Native EFI support
u u
libefi
libefi
u u
libefishell
libefishell
l l
Portability support
Portability support
u u
libc
libc
u u
libsocket
libsocket
l l
Platform management support
Platform management support
u u
libsmbios
libsmbios
u u
libm
libm
u u
libdb
libdb

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
linking dependency
lib
libefi libefishell libc Initialization Routine
libefi InitializeLib *
libefishell D InitializeShellAppliation *
libc I D InitializeLibC *
libsocket I I D EfiSocketInit *
libm I I I InitializeLibM
libdb I I I none
libsmbios D I D SMBIOS_Initialize
D = Direct dependency I = Indirect dependency
* Implicit library initialization when using the
_LIBC_Start_Shellapp_[AU] entry points

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Standard EFI entry point
Standard EFI entry point
typdef typdef EFI_STATUS EFI_STATUS
(EFIAPI *EFI_IMAGE_ENTRY_POINT( (EFIAPI *EFI_IMAGE_ENTRY_POINT(
IN EFI_HANDLE IN EFI_HANDLE ImageHandle ImageHandle, ,
IN EFI_SYSTEM_TABLE IN EFI_SYSTEM_TABLE * *SystemTable SystemTable
); );
l l
Portability entry point
Portability entry point
int int
main( main( int argc int argc, char ** , char **argv argv ); ); // _LIBC_Start_ // _LIBC_Start_Shellapp Shellapp_A _A
int int
main( main( int argc int argc, , wchar wchar_t ** _t **argv argv ); ); // _LIBC_Start_ // _LIBC_Start_Shellapp Shellapp_U _U
l l
Portability special exit
Portability special exit
void void
_LIBC_EfiExit( (
IN EFI_STATUS Status, IN EFI_STATUS Status,
IN UINTN IN UINTN DataSize DataSize, ,
IN CHAR16 * IN CHAR16 *ExitData ExitData
); );

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
ROOT = f: ROOT = f:\ \toolkit toolkit
PROCESSOR = ia32 PROCESSOR = ia32
ENVIRONMENT = EFI32 ENVIRONMENT = EFI32
ENTRY_POINT = LIBC_Start_ ENTRY_POINT = LIBC_Start_Shellapp Shellapp_A _A
IMAGE_TYPE = app IMAGE_TYPE = app # app, # app, bsdrv bsdrv, or , or rtdrv rtdrv
INC_ROOT = $(ROOT) INC_ROOT = $(ROOT)\ \include include
LIB_ROOT = $(ROOT) LIB_ROOT = $(ROOT)\ \lib lib
CC = CC = cl cl
LD = link LD = link
FWIMAGE = $(ROOT) FWIMAGE = $(ROOT)\ \build build\ \tools tools\ \bin bin\ \fwimage fwimage.exe .exe
CFLAGS = / CFLAGS = /nologo nologo $(INC_PATH) /W3 /Gm /GX / $(INC_PATH) /W3 /Gm /GX /Zi Zi / /Od Od / /Gf Gf / /Gy Gy /D $(ENVIRONMENT) /D $(ENVIRONMENT)
LDFLAGS = / LDFLAGS = /nologo nologo /MACHINE:IX86 /subsystem:console /NODEFAULTLIB /INCREMENTAL:NO /MACHINE:IX86 /subsystem:console /NODEFAULTLIB /INCREMENTAL:NO /MAP /DEBUG /DLL /MAP /DEBUG /DLL
INC_PATH = INC_PATH = - -X X \ \
- -I $(INC_ROOT)/ I $(INC_ROOT)/efi efi \ \
- -I $(INC_ROOT)/ I $(INC_ROOT)/efi efi/$(PROCESSOR) /$(PROCESSOR) \ \
- -I $(INC_ROOT)/ I $(INC_ROOT)/bsd bsd \ \
- -I $(INC_ROOT)/ I $(INC_ROOT)/efishell efishell
SOURCE = file1.c SOURCE = file1.c \ \
file2.c file2.c \ \
OBJECTS = file1. OBJECTS = file1.obj obj \ \
file2. file2.obj obj \ \
LIBS = $(LIB_ROOT)/ LIBS = $(LIB_ROOT)/libefi libefi.lib .lib \ \
$(LIB_ROOT)/ $(LIB_ROOT)/libefishell libefishell.lib .lib \ \
$(LIB_ROOT)/libc.lib $(LIB_ROOT)/libc.lib \ \
foo foo. .efi efi: : foo foo. .dll dll
$(FWIMAGE) $(IMAGE_TYPE) $*. $(FWIMAGE) $(IMAGE_TYPE) $*.dll dll $@ $@
foo foo. .dll dll: $(OBJECTS) : $(OBJECTS)
$(LD) $(LDFLAGS) /ENTRY:$(ENTRY_POINT) $(LIBS) $** /OUT:$*. $(LD) $(LDFLAGS) /ENTRY:$(ENTRY_POINT) $(LIBS) $** /OUT:$*.dll dll
file1. file1.obj obj: : file1.c file1.h file1.c file1.h
file2. file2.obj obj: : file2.c file2.c
clean: clean:
rm rm $(OBJECTS) $(OBJECTS) foo foo. .dll foo dll foo. .efi foo efi foo. .pdb foo pdb foo.map vc60.* .map vc60.*
**Note libraries have been moved from their default locations. **Note libraries have been moved from their default locations.

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Required environment variables
Required environment variables
u u
SDK_BUILD_ENV
SDK_BUILD_ENV
-
-
bios32, nt32, sal64, ...
bios32, nt32, sal64, ...
u u
SDK_INSTALL_DIR
SDK_INSTALL_DIR
-
-
root of toolkit source
root of toolkit source
u u
SDK_LIBPATH
SDK_LIBPATH
-
-
path to VC++ lib directory
path to VC++ lib directory
u u
IA64SDK_DIR
IA64SDK_DIR
-
-
path to IA64 compilers
path to IA64 compilers
u u
INCLUDE
INCLUDE
-
-
Normally set by VC++
Normally set by VC++
l l
Places output in standard locations
Places output in standard locations
l l
Use existing
Use existing
xxx
xxx
.
.
mak
mak
as a template
as a template

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l Apps Apps - - Native EFI example programs Native EFI example programs
l l build build - - Environment master files binary output Environment master files binary output
l l cmds cmds - - Ported FreeBSD programs Ported FreeBSD programs
l l doc doc - - User guides, man pages, and User guides, man pages, and decsign decsign
documentation documentation
l l efishell efishell - - The shell and shell utilities The shell and shell utilities
l l include include - - Public include files Public include files
l l lib lib - - Public toolkit libraries Public toolkit libraries
l l protocols protocols - - Toolkit drivers and protocols Toolkit drivers and protocols

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Overview
Overview
l l
Documentation
Documentation
l l
Shell and Boot Manager
Shell and Boot Manager
l l
Directory Structure
Directory Structure
l l
Development Environments
Development Environments
l l
EFI Application Toolkit Overview
EFI Application Toolkit Overview
l l
Sample Applications
Sample Applications
l l
EFI/SAL Integration
EFI/SAL Integration
l l
Open Lab
Open Lab

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
EFI Application
EFI Application
l l
EFI OS Loader
EFI OS Loader
l l
EFI External Shell Command
EFI External Shell Command
l l
EFI Internal Shell Command
EFI Internal Shell Command

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Create new directory
Create new directory
apps
apps
\
\
hello
hello
l l
Put
Put
hello.
hello.
mak
mak
in
in
apps
apps
\
\
hello
hello
l l
Put source code in
Put source code in
apps
apps
\
\
hello
hello
l l
Set Toolkit environment
Set Toolkit environment
l l
Run
Run
nmake
nmake
-
-
f hello.
f hello.
mak
mak
from
from
apps
apps
\
\
hello
hello

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
#include "efi.h" #include "efi.h"
EFI_STATUS EFI_STATUS
InitializeHelloApplication ( InitializeHelloApplication (
IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable IN EFI_SYSTEM_TABLE *SystemTable
) )
{ {
UINTN Index; UINTN Index;
SystemTable SystemTable- ->ConOut >ConOut- ->OutputString(SystemTable >OutputString(SystemTable- ->ConOut, >ConOut,
LHello application started LHello application started\ \n"); n");
SystemTable SystemTable- ->ConOut >ConOut- ->OutputString(SystemTable >OutputString(SystemTable- ->ConOut, >ConOut,
L" L"\ \n n\ \r r\ \n n\ \r r\ \n n\ \rHit any key to exit this image rHit any key to exit this image\ \n n\ \r"); r");
SystemTable SystemTable- -> >BootServices BootServices- -> >WaitForEvent WaitForEvent( (
1, &( 1, &(SystemTable SystemTable- -> >ConIn ConIn- -> >WaitForKey WaitForKey), &Index); ), &Index);
SystemTable SystemTable- -> >ConOut ConOut- -> >OutputString OutputString( (SystemTable SystemTable- -> >ConOut ConOut, ,
L" L"\ \n n\ \r r\ \n n\ \r"); r");
return EFI_SUCCESS; return EFI_SUCCESS;
} }

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
#include "efi.h" #include "efi.h"
#include "efilib.h" #include "efilib.h"
EFI_STATUS EFI_STATUS
InitializeHelloLibApplication ( InitializeHelloLibApplication (
IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable IN EFI_SYSTEM_TABLE *SystemTable
) )
{ {
InitializeLib (ImageHandle, SystemTable); InitializeLib (ImageHandle, SystemTable);
Print(L" Print(L"\ \n n\ \n n\ \nHelloLib application started nHelloLib application started\ \n n\ \n n\ \n"); n");
Print(L" Print(L"\ \nHit any key to exit this image nHit any key to exit this image\ \n"); n");
WaitForSingleEvent(ST WaitForSingleEvent(ST- ->ConIn >ConIn- ->WaitForKey,0); >WaitForKey,0);
ST ST- -> >ConOut ConOut- -> >OutputString OutputString (ST (ST- -> >ConOut ConOut, L" , L"\ \n n\ \r r\ \n n\ \r"); r");
return EFI_SUCCESS; return EFI_SUCCESS;
} }

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
#include < #include <atk atk_libc.h> _libc.h>
EFI_STATUS EFI_STATUS
InitializeHelloLibCApplication ( InitializeHelloLibCApplication (
IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable IN EFI_SYSTEM_TABLE *SystemTable
) )
{ {
InitializeLib(ImageHandle, SystemTable); InitializeLib(ImageHandle, SystemTable);
printf printf("Hello ("Hello LibC LibC application started application started\ \n n\ \n n\ \n"); n");
printf printf("Hit C/R to exit this image ("Hit C/R to exit this image\ \n"); n");
return( return( getchar getchar() ); () );
} }

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l Initialization Initialization
l l Device Path and Image Information Device Path and Image Information
l l Opening a Volume Opening a Volume
l l Reading a File Reading a File
l l Finding an OS Partition Finding an OS Partition
l l Getting the Current System Configuration Getting the Current System Configuration
l l Getting the Current Memory Map Getting the Current Memory Map
l l Getting the Current Environment Getting the Current Environment
Variables
Variables
l l Transitioning to an OS Kernel Transitioning to an OS Kernel

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
#include "efi.h" #include "efi.h"
#include "efilib.h" #include "efilib.h"
EFI_STATUS EFI_STATUS
InitializeOSLoader ( InitializeOSLoader (
IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable IN EFI_SYSTEM_TABLE *SystemTable
) )
{ {
... ...
InitializeLib (ImageHandle, SystemTable); InitializeLib (ImageHandle, SystemTable);
Print(L"OS Loader application started Print(L"OS Loader application started\ \n"); n");
... ...

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
EFI_LOADED_IMAGE *LoadedImage; EFI_LOADED_IMAGE *LoadedImage;
EFI_DEVICE_PATH *DevicePath; EFI_DEVICE_PATH *DevicePath;
... ...
BS BS- ->HandleProtocol(ImageHandle, >HandleProtocol(ImageHandle,
&LoadedImageProtocol, &LoadedImageProtocol,
&LoadedImage); &LoadedImage);
BS BS- ->HandleProtocol(LoadedImage >HandleProtocol(LoadedImage- ->DeviceHandle, >DeviceHandle,
&DevicePathProtocol, &DevicePathProtocol,
&DevicePath); &DevicePath);
Print (L"Image device : %s Print (L"Image device : %s\ \n", DevicePathToStr (DevicePath)); n", DevicePathToStr (DevicePath));
Print (L"Image file : %s Print (L"Image file : %s\ \n", DevicePathToStr (LoadedImage n", DevicePathToStr (LoadedImage- ->FilePath)); >FilePath));
Print (L"Image Base : %X Print (L"Image Base : %X\ \n", LoadedImage n", LoadedImage- ->ImageBase); >ImageBase);
Print (L"Image Size : %X Print (L"Image Size : %X\ \n", LoadedImage n", LoadedImage- ->ImageSize); >ImageSize);

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
EFI_FILE_IO_INTERFACE *Vol; EFI_FILE_IO_INTERFACE *Vol;
EFI_FILE_HANDLE RootFs; EFI_FILE_HANDLE RootFs;
EFI_FILE_HANDLE CurDir; EFI_FILE_HANDLE CurDir;
BS BS- ->HandleProtocol(LoadedImage >HandleProtocol(LoadedImage- ->DeviceHandle, &FileSystemProtocol, &Vol); >DeviceHandle, &FileSystemProtocol, &Vol);
Vol Vol- ->OpenVolume (Vol, &RootFs); >OpenVolume (Vol, &RootFs);
CurDir = RootFs; CurDir = RootFs;

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
EFI_FILE_HANDLE CurDir; EFI_FILE_HANDLE CurDir;
EFI_FILE_HANDLE FileHandle; EFI_FILE_HANDLE FileHandle;
CHAR16 FileName[100]; CHAR16 FileName[100];
UINTN i; UINTN i;
UINTN Size; UINTN Size;
VOID *OsKernelBuffer; VOID *OsKernelBuffer;
StrCpy(FileName,DevicePathToStr(LoadedImage StrCpy(FileName,DevicePathToStr(LoadedImage- ->FilePath)); >FilePath));
for(i=StrLen(FileName);i>=0 && FileName[i]!= for(i=StrLen(FileName);i>=0 && FileName[i]!=\ \\ \;i ;i-- --); );
FileName[i] = 0; FileName[i] = 0;
StrCat(FileName,L" StrCat(FileName,L"\ \\ \OSKERNEL.BIN"); OSKERNEL.BIN");
CurDir CurDir- ->Open (CurDir, &FileHandle, FileName, EFI_FILE_MODE_READ, 0); >Open (CurDir, &FileHandle, FileName, EFI_FILE_MODE_READ, 0);
Size = 0x00100000; Size = 0x00100000;
BS BS- ->AllocatePool(EfiLoaderData, Size, &OsKernelBuffer); >AllocatePool(EfiLoaderData, Size, &OsKernelBuffer);
FileHandle FileHandle- ->Read(FileHandle, &Size, OsKernelBuffer); >Read(FileHandle, &Size, OsKernelBuffer);
FileHandle FileHandle- ->Close(FileHandle); >Close(FileHandle);

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
UINTN NoHandles; UINTN NoHandles;
EFI_HANDLE *HandleBuffer; EFI_HANDLE *HandleBuffer;
EFI_BLOCK_IO *BlkIo; EFI_BLOCK_IO *BlkIo;
EFI_BLOCK_IO_MEDIA Media; EFI_BLOCK_IO_MEDIA Media;
UINT8 *Block; UINT8 *Block;
UINT32 MediaId; UINT32 MediaId;
NoHandles = 0; NoHandles = 0;
HandleBuffer = NULL; HandleBuffer = NULL;
LibLocateHandle(ByProtocol, &BlockIoProtocol, NULL, LibLocateHandle(ByProtocol, &BlockIoProtocol, NULL,
&NoHandles, &HandleBuffer); &NoHandles, &HandleBuffer);
for(i=0;i<NoHandles;i++) { for(i=0;i<NoHandles;i++) {
BS BS- ->HandleProtocol (HandleBuffer[i], &DevicePathProtocol, &DevicePa >HandleProtocol (HandleBuffer[i], &DevicePathProtocol, &DevicePath); th);
BS BS- ->HandleProtocol (HandleBuffer[i], &BlockIoProtocol, &BlkIo); >HandleProtocol (HandleBuffer[i], &BlockIoProtocol, &BlkIo);
Media = BlkIo Media = BlkIo- ->Media; >Media;
Block = AllocatePool (Media Block = AllocatePool (Media- ->BlockSize); >BlockSize);
MediaId = Media MediaId = Media- ->MediaId; >MediaId;
BlkIo BlkIo- ->ReadBlocks(BlkIo, MediaId, (EFI_LBA)0, Media >ReadBlocks(BlkIo, MediaId, (EFI_LBA)0, Media- ->BlockSize, Block); >BlockSize, Block);
Print(L" Print(L"\ \nBlock #0 of device %s nBlock #0 of device %s\ \n",DevicePathToStr(DevicePath)); n",DevicePathToStr(DevicePath));
DumpHex(0,0,BlkIo DumpHex(0,0,BlkIo- ->BlockSize,Block); >BlockSize,Block);
} }

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
VOID * VOID *AcpiTable AcpiTable; ;
VOID * VOID *SMBIOSTable SMBIOSTable; ;
VOID * VOID *SalSystemTable SalSystemTable; ;
VOID * VOID *MpsTable MpsTable; ;
LibGetSystemConfigurationTable LibGetSystemConfigurationTable(& (&AcpiTableGuid AcpiTableGuid, & , &AcpiTable AcpiTable); );
LibGetSystemConfigurationTable LibGetSystemConfigurationTable(& (&SMBIOSTableGuid SMBIOSTableGuid, & , &SMBIOSTable SMBIOSTable); );
LibGetSystemConfigurationTable LibGetSystemConfigurationTable(& (&SalSystemTableGuid SalSystemTableGuid,& ,&SalSystemTable SalSystemTable); );
LibGetSystemConfigurationTable LibGetSystemConfigurationTable(& (&MpsTableGuid MpsTableGuid, & , &MpsTable MpsTable); );
Print(L" MPS Table is at address : %X Print(L" MPS Table is at address : %X\ \n", n",MpsTable MpsTable); );
Print(L" ACPI Table is at address : %X Print(L" ACPI Table is at address : %X\ \n", n",AcpiTable AcpiTable); );
Print(L" SMBIOS Table is at address : %X Print(L" SMBIOS Table is at address : %X\ \n", n",SMBIOSTable SMBIOSTable); );
Print(L" Sal System Table is at address : %X Print(L" Sal System Table is at address : %X\ \n", n",SalSystemTable SalSystemTable); );

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
EFI_MEMORY_DESCRIPTOR *MemoryMap; EFI_MEMORY_DESCRIPTOR *MemoryMap;
EFI_MEMORY_DESCRIPTOR *MemoryMapEntry; EFI_MEMORY_DESCRIPTOR *MemoryMapEntry;
UINTN NoEntries; UINTN NoEntries;
UINTN MapKey; UINTN MapKey;
UINTN UINTN DescriptorSize DescriptorSize; ;
UINT32 UINT32 DescriptorVersion DescriptorVersion; ;
MemoryMap = LibMemoryMap(&NoEntries,&MapKey, MemoryMap = LibMemoryMap(&NoEntries,&MapKey,
&DescriptorVersion,&DescriptorSize) &DescriptorVersion,&DescriptorSize); ;
Print(L"Memory Descriptor List: Print(L"Memory Descriptor List:\ \n n\ \n"); n");
Print(L" Type Start Address End Address Attri Print(L" Type Start Address End Address Attributes butes \ \n"); n");
Print(L" ========== ================ ================ ==== Print(L" ========== ================ ================ ================ ============\ \n"); n");
MemoryMapEntry MemoryMapEntry = = MemoryMap MemoryMap; ;
for(i=0;i< for(i=0;i<NoEntries NoEntries;i++) { ;i++) {
Print(L" %s % Print(L" %s %lX lX % %lX lX % %lX lX\ \n", n",
OsLoaderMemoryTypeDesc OsLoaderMemoryTypeDesc[ [MemoryMapEntry MemoryMapEntry- ->Type], >Type],
MemoryMapEntry MemoryMapEntry- -> >PhysicalStart PhysicalStart, ,
MemoryMapEntry MemoryMapEntry- -> >PhysicalStart PhysicalStart + +
LShiftU64( LShiftU64(MemoryMapEntry MemoryMapEntry- -> >NumberOfPages NumberOfPages,PAGE_SHIFT) ,PAGE_SHIFT)- -1, 1,
MemoryMapEntry MemoryMapEntry- ->Attribute); >Attribute);
MemoryMapEntry MemoryMapEntry = = NextMemoryDescriptor NextMemoryDescriptor( (MemoryMapEntry MemoryMapEntry, ,DescriptorSize DescriptorSize); );
} }

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
UINTN VariableNameSize; UINTN VariableNameSize;
CHAR16 VariableName[256]; CHAR16 VariableName[256];
EFI_GUID VendorGuid; EFI_GUID VendorGuid;
UINT8 *VariableValue; UINT8 *VariableValue;
VariableName[0] = 0x0000; VariableName[0] = 0x0000;
VendorGuid = NullGuid; VendorGuid = NullGuid;
Print(L"GUID Variable Name V Print(L"GUID Variable Name Value alue\ \n"); n");
Print(L"================================== =================== = Print(L"================================== =================== ======= ======\ \n"); n");
do { do {
VariableNameSize = 256; VariableNameSize = 256;
Status = RT Status = RT- ->GetNextVariableName(&VariableNameSize, VariableName, >GetNextVariableName(&VariableNameSize, VariableName,
&VendorGuid); &VendorGuid);
if (Status == EFI_SUCCESS) { if (Status == EFI_SUCCESS) {
VariableValue = LibGetVariable(VariableName,&VendorGuid); VariableValue = LibGetVariable(VariableName,&VendorGuid);
Print(L"%. Print(L"%.- -35g %. 35g %.- -20s %X 20s %X\ \n",&VendorGuid,VariableName,VariableValue); n",&VendorGuid,VariableName,VariableValue);
} }
} while (Status == EFI_SUCCESS); } while (Status == EFI_SUCCESS);

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
EFI_MEMORY_DESCRIPTOR *MemoryMap; EFI_MEMORY_DESCRIPTOR *MemoryMap;
UINTN NoEntries; UINTN NoEntries;
UINTN MapKey; UINTN MapKey;
MemoryMap = LibMemoryMap(&NoEntries,&MapKey,&DescriptorSize,&D MemoryMap = LibMemoryMap(&NoEntries,&MapKey,&DescriptorSize,&DescriptorVersion); escriptorVersion);
BS BS- ->ExitBootServices(ImageHandle,MapKey); >ExitBootServices(ImageHandle,MapKey);

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Create new directory
Create new directory
efishell
efishell
\
\
testcmd
testcmd
l l
Put
Put
testcmd
testcmd
.
.
mak
mak
in
in
efishell
efishell
\
\
testcmd
testcmd
l l
Put source code in
Put source code in
efishell
efishell
\
\
testcmd
testcmd
l l
Run
Run
nmake
nmake
-
-
f
f
testcmd
testcmd
.
.
mak
mak
from
from
efishell
efishell
\
\
testcmd
testcmd

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
#include "shell.h #include "shell.h
EFI_STATUS EFI_STATUS
InitializeTestCommand InitializeTestCommand ( (
IN EFI_HANDLE IN EFI_HANDLE ImageHandle ImageHandle, ,
IN EFI_SYSTEM_TABLE * IN EFI_SYSTEM_TABLE *SystemTable SystemTable
) )
{ {
CHAR16 ** CHAR16 **Argv Argv; ;
UINTN UINTN Argc Argc,i; ,i;
InitializeShellApplication InitializeShellApplication ( (ImageHandle ImageHandle, , SystemTable SystemTable); );
Argv Argv = SI = SI- -> >Argv Argv; ;
Argc Argc = SI = SI- -> >Argc Argc; ;
for(i=0;i< for(i=0;i<Argc Argc;i++) { ;i++) {
Print(L" Print(L"Argv Argv[%d] = %s [%d] = %s\ \n",i, n",i,Argv Argv[i]); [i]);
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
#include < #include <stdio stdio.h> .h>
int int
main( main(int argc int argc, char ** , char **argv argv) )
{ {
int int i; i;
for(i=0;i< for(i=0;i<argc argc;i++) { ;i++) {
printf printf( (argv argv[%d] = %s [%d] = %s\ \n",i, n",i,argv argv[i]); [i]);
} }
return( 3 );
} }

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
EFI Shell Exercises
EFI Shell Exercises
l l
EFI Development Environments
EFI Development Environments
l l
Sample EFI Applications
Sample EFI Applications
l l
Sample EFI Shell Applications
Sample EFI Shell Applications

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Overview
Overview
l l
Documentation
Documentation
l l
Shell and Boot Manager
Shell and Boot Manager
l l
Directory Structure
Directory Structure
l l
Development Environments
Development Environments
l l
EFI Application Toolkit Overview
EFI Application Toolkit Overview
l l
Sample Applications
Sample Applications
l l
EFI/SAL Integration
EFI/SAL Integration
l l
Open Lab
Open Lab

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Reference Implementation
Reference Implementation

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
IA
IA
-
-
64 Software Stack
64 Software Stack
l l
EFI + SAL Integration
EFI + SAL Integration
l l
SAL changes due to EFI
SAL changes due to EFI
l l
Porting EFI to an IA
Porting EFI to an IA
-
-
64 Platform
64 Platform
l l
Debug hints
Debug hints

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Reads and
writes of I/O
registers
3ODWIRUPKDUGZDUH 3ODWIRUPKDUGZDUH
3URFHVVRUKDUGZDUH 3URFHVVRUKDUGZDUH
2SHUDWLQJ6\VWHP6RIWZDUH 2SHUDWLQJ6\VWHP6RIWZDUH
3URFHVVRU$EVWUDFWLRQ/D\HU3$/ 3URFHVVRU$EVWUDFWLRQ/D\HU3$/
6\VWHP$EVWUDFWLRQ/D\HU6$/ 6\VWHP$EVWUDFWLRQ/D\HU6$/
OS boot
handoff
SAL
procedure
calls
Instruction
execution
PAL proce-
dure calls
PAL procedure calls
Transfers to SAL
entrypoints
Interrupts, traps
and faults
Access to
platform
resources
Performance critical
hardware events,
e.g., interrupts
Non-performance critical
hardware events, e.g.,
reset, machine checks
IA-32 BIOS
(), (),
EFI services

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l EFI code invoked from SAL as last step prior to EFI code invoked from SAL as last step prior to
OS boot OS boot
u uEFI code is built as a separate entity (EFI64.exe) EFI code is built as a separate entity (EFI64.exe)
u uEntry present in FIT (Firmware Interface Table) for EFI Entry present in FIT (Firmware Interface Table) for EFI
binary location in ROM. Uncompressed and shadowed to binary location in ROM. Uncompressed and shadowed to
RAM during firmware init RAM during firmware init
u uEFI + SAL + PAL + IA EFI + SAL + PAL + IA- -32Bios constitutes new FW.bin 32Bios constitutes new FW.bin
u uControl passed to EFI, similar to booting of EM Control passed to EFI, similar to booting of EM- -OS OS
u uEFI will present BootManager choices for user selection EFI will present BootManager choices for user selection
If IA If IA- -32 OS detected then control comes back to SAL for 32 OS detected then control comes back to SAL for
proper handling proper handling
If EM If EM- -OS is being booted, and native EFI drivers are OS is being booted, and native EFI drivers are
present, then an IA present, then an IA- -32 BIOS will not be required. 32 BIOS will not be required.
u uEFI calls SAL where ever necessary EFI calls SAL where ever necessary

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l SALProc SALProc runtime calls trimmed runtime calls trimmed
u uRedundant SALProc calls removed (see updated SAL Redundant SALProc calls removed (see updated SAL
spec) spec)
u uOS would now make a mix of PAL, SAL and EFI calls OS would now make a mix of PAL, SAL and EFI calls
l l NVRAM functionality absorbed inside of EFI NVRAM functionality absorbed inside of EFI
l l BootManager(BM) functionality moved to EFI BootManager(BM) functionality moved to EFI
u uEFI would detect type of OS selected by user EFI would detect type of OS selected by user
u uEFI loads EM EFI loads EM- -OS directly OS directly
u uEFI calls back to SAL for IA EFI calls back to SAL for IA- -32 OS loading 32 OS loading
u uProvides ability to add new user options Provides ability to add new user options
l l OS will get memory map from EFI OS will get memory map from EFI

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
All the table pointers now appear in EFI
All the table pointers now appear in EFI
System table
System table
u uACPI, MPS and SST pointers should be ACPI, MPS and SST pointers should be
retrieved from EFI ST retrieved from EFI ST
l l
EFI BM provides capability to add
EFI BM provides capability to add
functionality like drivers, compliance
functionality like drivers, compliance
tests etc.
tests etc.

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Look at
Look at \ \efi efi\ \corefw corefw\ \fw fw\ \platform platform\ \sal sal
Reference Implementation Reference Implementation
Assumes a PC Assumes a PC- -AT architecture AT architecture
Makes use of SAL callbacks Makes use of SAL callbacks
l l
Implement SAL Callbacks
Implement SAL Callbacks
Not required Not required
Will make porting task much simpler Will make porting task much simpler
l l
SAL launches EFI
SAL launches EFI
Not required Not required
A merged SAL/EFI is possible A merged SAL/EFI is possible
l l
Recovery issues
Recovery issues

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Load and relocate EFI code
Load and relocate EFI code
u uTypically loaded from FLASH Typically loaded from FLASH
l l
Call
Call
MainEntry
MainEntry
()
()
u uLocated in Located in \ \efi efi\ \corefw corefw\ \fw fw\ \platform platform\ \sal sal\ \init.c init.c
l l
Initialize EFI System Table
Initialize EFI System Table
l l
Initialize System Configuration Tables
Initialize System Configuration Tables
l l
Initialize the EFI Memory Map
Initialize the EFI Memory Map
l l
Initialize the EFI Library
Initialize the EFI Library

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Install Base Devices
Install Base Devices
u uInstall DEVICE_IO Protocols Install DEVICE_IO Protocols
u uInitialize NVRAM devices Initialize NVRAM devices
l l
Install Console Devices
Install Console Devices
u uInstall SIMPLE_INPUT Protocol Install SIMPLE_INPUT Protocol
u uInstall SIMPLE_TEXT_OUTPUT Protocol Install SIMPLE_TEXT_OUTPUT Protocol
l l
Install System Volumes
Install System Volumes
u uInitialize BLOCK_IO Protocol Instances Initialize BLOCK_IO Protocol Instances
u uInitialize DISK_IO Protocol Instances Initialize DISK_IO Protocol Instances
u uInitialize FILE_SYSTEM Protocol Instances Initialize FILE_SYSTEM Protocol Instances

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Install Other Devices
Install Other Devices
u uOEM specific devices available from EFI OEM specific devices available from EFI
l l
Call the EFI Boot Manager
Call the EFI Boot Manager
u uOEM Value Add Area OEM Value Add Area
u uLaunches OS Loader Launches OS Loader
u uLaunches OS Setup Utility Launches OS Setup Utility
u uLaunches EFI Shell Launches EFI Shell
u uLaunches Utilities Launches Utilities
u uLaunches Diagnostics Launches Diagnostics

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Implement NVRAM access functions
Implement NVRAM access functions
l l
Implement RTC access functions
Implement RTC access functions
l l
Implement Boot Device Drivers
Implement Boot Device Drivers
u uReference Implementation uses INT calls Reference Implementation uses INT calls
u uNative EFI device drivers are an option Native EFI device drivers are an option
u uKeyboard Keyboard
u uDisplay Display
u uDisk Disk
u uSerial Serial
u uNetwork Network

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
General
General
l l Identify what call (EFI, SAL or PAL) exactly fails Identify what call (EFI, SAL or PAL) exactly fails
l l Certain EFI calls are handled entirely within EFI and Certain EFI calls are handled entirely within EFI and
dont need to call SAL dont need to call SAL
u uEx: HandleProtocol, Locatexxx, Memory map Ex: HandleProtocol, Locatexxx, Memory map
l l Almost all calls that interact with media would be a Almost all calls that interact with media would be a
mix of EFI , SAL and IA mix of EFI , SAL and IA- -32 bios code 32 bios code
u uConIn or ConOut functions of EFI will call SAL, which in ConIn or ConOut functions of EFI will call SAL, which in
turn would call IA turn would call IA- -32 Bios 32 Bios
u uNVRAM calls might need talking through the Flash NVRAM calls might need talking through the Flash
manager to access device manager to access device
u uBlkIO functions use SAL callback and Int13 BlkIO functions use SAL callback and Int13
interface of Bios interface of Bios

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
General
General
l l Documentation provided with binaries Documentation provided with binaries
u uEFI Developers guide provides samples and usage of EFI Developers guide provides samples and usage of
various functions various functions
u uRelease notes (EFI and SAL) provide the level of Release notes (EFI and SAL) provide the level of
support provided in a particular release support provided in a particular release
u uSAL spec details SAL implementation SAL spec details SAL implementation
u uOS sample loader code that would show how to write a OS sample loader code that would show how to write a
simple OS boot loader. Number of sample apps simple OS boot loader. Number of sample apps
provided also provided also
l l EFI shell provides way to recreate the fail EFI shell provides way to recreate the fail
scenario by writing smaller EFI images for debug scenario by writing smaller EFI images for debug
l l Running SAL compliance tests and EFI Running SAL compliance tests and EFI
diagnostics could narrow down the problem diagnostics could narrow down the problem

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Media related
Media related
l l Can not access hard drive Can not access hard drive
u uSee See efiboot efiboot. .sim sim or or fw fw. .sim sim for define (Ord1 for define (Ord1
0x475=number of HDs) 0x475=number of HDs)
u uSee See Usercfg.inc Usercfg.inc for HD definition (PHYSICALDRIVEnn) for HD definition (PHYSICALDRIVEnn)
u uCheck if HD supports FAT16 or FAT32 partition Check if HD supports FAT16 or FAT32 partition
u uFrom EFI shell prompt running dh should show atleast From EFI shell prompt running dh should show atleast
one handle with fs protocol one handle with fs protocol
u uBy default only one hard drive declared in script (0x475=1) By default only one hard drive declared in script (0x475=1)
u uRemove delta_out option when starting simulator Remove delta_out option when starting simulator
u uRun CHKDSK before and after running simulator Run CHKDSK before and after running simulator

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Media related
Media related
l l Can not access floppy Can not access floppy
u uFloppy emulation is not supported in Floppy emulation is not supported in SoftSDV SoftSDV, however , however
code exists in EFI to detect floppy devices code exists in EFI to detect floppy devices
l l Can not access CDROM device Can not access CDROM device
u uSee See efiboot efiboot. .sim sim or or fw fw. .sim sim for proper declaration of for proper declaration of
CDRom CDRom
u uCurrently only one Currently only one CDRom CDRom enabled, with a device number enabled, with a device number
of 0x9f of 0x9f
u uAssumed to be readonly Assumed to be readonly
u uNeed proper filesystem for enumeration by EFI Need proper filesystem for enumeration by EFI
one way would be to generate a floppy bin image and load one way would be to generate a floppy bin image and load
into CD, resulting in FAT12 like image into CD, resulting in FAT12 like image
Special tool might be needed to create FAT32 type Special tool might be needed to create FAT32 type
image directly on CD image directly on CD

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Shell/Image related
Shell/Image related
l l Can not load EFI image Can not load EFI image
u u Make sure image is of EFI type (App, RtDrv, BSDrv) Make sure image is of EFI type (App, RtDrv, BSDrv)
PE32+ images should be patched by running PE32+ images should be patched by running
fwimage.exe to generate EFI image of needed type fwimage.exe to generate EFI image of needed type
Conversion of PE32+ images only supported at this point Conversion of PE32+ images only supported at this point
u u Image should be in path Image should be in path
Default path is : fs0: Default path is : fs0:\ \efi efi\ \tools;fs0: tools;fs0:\ \;. ;.
This path can be modified from the shell prompt. This path can be modified from the shell prompt.
u u There should be enough memory for loading of this image There should be enough memory for loading of this image
Memmap shell command shows available free memory Memmap shell command shows available free memory
l l Can not add/execute custom shell command Can not add/execute custom shell command
u u Make sure it is an EFI image Make sure it is an EFI image
u u Good documentation in EFI Good documentation in EFI\ \notes directory on how to notes directory on how to
add shell commands (internal and standalone) add shell commands (internal and standalone)

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
Shell/Image related
Shell/Image related
l l String processing String processing
u uAll of EFI assumes Unicode strings All of EFI assumes Unicode strings
Declare Unicode strings using the L prefix Declare Unicode strings using the L prefix
u uType Type - -a shell command prints a shell command prints ascii ascii text text

OS
Loader
Hardware
BIOS
EFI
C
o
m
p
a
t
i
b
i
l
i
t
y
l l
Overview
Overview
l l
Documentation
Documentation
l l
Shell and Boot Manager
Shell and Boot Manager
l l
Directory Structure
Directory Structure
l l
Development Environments
Development Environments
l l
EFI Application Toolkit Overview
EFI Application Toolkit Overview
l l
Sample Applications
Sample Applications
l l
EFI/SAL Integration
EFI/SAL Integration
l l
Open Lab
Open Lab

You might also like