Skip to content

Commit 3c07aba

Browse files
committed
update simple guide and add Debug.md
1 parent 117f20f commit 3c07aba

22 files changed

+272
-247
lines changed

.vitepress/en.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ function sidebarDocs(): DefaultTheme.SidebarItem[] {
5858
items: [
5959
{ text: 'UEFI Porting Guide', link: '/PortingGuides/SimpleGuide'},
6060
{ text: 'Definitions', link: '/PortingGuides/DefinesGuidance'},
61-
{ text: '[Deprecated]Find Protocol Addresses For Kailua', link: '/PortingGuides/FindProtocolAddressesForKailua'},
61+
{ text: 'Debugging', link: '/PortingGuides/Debug'},
62+
{ text: '[Deprecated]Find Protocol Addresses', link: '/PortingGuides/FindProtocolAddresses'},
6263
]
6364
},
6465
{

.vitepress/zh.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function sidebarDocs(): DefaultTheme.SidebarItem[] {
4646
items: [
4747
{ text: 'Project-Aloha', link: '/Introduction/organization'},
4848
{ text: 'mu_aloha_platforms', link: '/Introduction/mu_aloha_platforms'},
49-
{ text: 'CrDK', link: '/Introduction/CrDK'},
49+
{ text: 'Crane开发套件', link: '/Introduction/CrDK'},
5050
{ text: '移植状态', link: '/PortingStatus/PortingStatus'}
5151
]
5252
},
@@ -62,7 +62,8 @@ function sidebarDocs(): DefaultTheme.SidebarItem[] {
6262
{
6363
text: 'UEFI移植',
6464
items: [
65-
{ text: '简易移植教程', link: '/PortingGuides/SimpleGuide'}
65+
{ text: '设备移植简述', link: '/PortingGuides/SimpleGuide'},
66+
{ text: '调试', link: '/PortingGuides/Debug'}
6667
]
6768
},
6869
{

PortingGuides/Debug.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Debugging Skills
2+
3+
## Enable log output
4+
Our UEFI provides 4 ways currently for getting UEFI logs.
5+
```
6+
USE_SCREEN_FOR_SERIAL_OUTPUT = 0
7+
USE_UART_GENI_FOR_SERIAL_OUTPUT = 0
8+
USE_UART_DM_FOR_SERIAL_OUTPUT = 0
9+
USE_MEMORY_FOR_SERIAL_OUTPUT = 0
10+
```
11+
Only one of them can be enabled at the same time.
12+
13+
### USE_SCREEN_FOR_SERIAL_OUTPUT
14+
Set to **1** to enable serial output via screen. Logs will be printed to screen
15+
directly. This way is very **useful** for devices without a UART.
16+
17+
### USE_UART_GENI_FOR_SERIAL_OUTPUT
18+
Set to **1** to enable serial output via a real serial port. Logs will be printed
19+
to the geni uart address at `gAndromedaPkgTokenSpaceGuid.PcdUartSerialBase` which is defined in
20+
*Silicon/QC/XXX/QcomPkg/QcomPkg.dsc.inc*.
21+
22+
### USE_UART_DM_FOR_SERIAL_OUTPUT
23+
Similar to **USE_UART_GENI_FOR_SERIAL_OUTPUT**. It's used for older Qualcomm platforms like msm8996.
24+
25+
### USE_MEMORY_FOR_SERIAL_OUTPUT
26+
Set to **1** to print logs to pstore memory. It's useful when you have JTAG or EUD enabled on your
27+
device. The log output region is defined in your device's *Library/PlatformMemoryMapLib/PlatformMemoryMapLib.c*.
28+
The region must be named *PStore* like this:
29+
```
30+
{"PStore", <StartAddress>, <Size>, AddMem, MEM_RES, SYS_MEM_CAP, Reserv, WRITE_THROUGH_XN},
31+
```

PortingGuides/DefinesGuidance.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,7 @@
1111
- If `HAS_MLVM = TRUE`, the MLVM regions will be reserved, so HLOS will not use this region.
1212
- Total RAM size will decrease about 400MB.
1313
* Where used it ?
14-
- `HAS_MLVM` is used in `Platforms/SurfaceDuoFamilyPkg/Driver/RamPartitionDxe/ExtendedMemoryMap.h`.
15-
16-
## **CUST_PLATFORM_PRE_PI_LIB**
17-
:::warning Deprecated
18-
This definition and codes are removed.
19-
Please use DualBoot Patcher build dual boot kernel.
20-
:::
21-
* Type
22-
- Boolean
23-
* Why define it ?
24-
- Some device may want to customized `IsLinuxBootRequested()` function in Library/PlatformPrePiLib/PlatformUtils.c
25-
- The `IsLinuxBootRequested()` function is used to judge the direction where to boot.
26-
+ return `TRUE`
27-
* boot to Android
28-
+ return `FALSE`
29-
* boot to UEFI
30-
* What happened when **1**?
31-
- The build-system will try to find PlatformPrePiLib under `Device/$(brand-codename)/Library/PlatformPrePiLib/`
32-
* Where used it ?
33-
- `CUST_PLATFORM_PRE_PI_LIB` is used in `Platforms/SurfaceDuoFamilyPkg/SurfaceDuoFamily.dsc.inc`
34-
- Line: 395
14+
- `HAS_MLVM` is used in `Platforms/AndromedaPkg/Driver/RamPartitionDxe/ExtendedMemoryMap.h`.
3515

3616
## **CUST_LOGO**
3717
* Type
@@ -41,4 +21,4 @@
4121
* What happened when **1**?
4222
- The Boot Logo will be replaced with the one under `Device/$(brand-codename)/Include/Resources/CustBootLogo.bmp`
4323
* Where used it ?
44-
- `CUST_LOGO` is used in `Platforms/SurfaceDuoFamilyPkg/Frontpage.fdf.inc`
24+
- `CUST_LOGO` is used in `Platforms/AndromedaPkg/Frontpage.fdf.inc`

PortingGuides/FindProtocolAddressesForKailua.md renamed to PortingGuides/FindProtocolAddresses.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# Find Protocol Addresses For Kailua
1+
# Find Protocol Addresses
22
:::warning WARNING
3-
This page is deprecated now, new uefi supports find address at run time.
3+
This page is deprecated now, new uefi supports find address at runtime.
4+
You only need to read this page when the online locator in uefi does not work.
45
:::
56

6-
On Sm8550, many uefi drivers need ***scheduler*** protocol and ***xbldt*** protocol.
7+
On Sm8550 and newer platforms, many uefi drivers need ***scheduler*** protocol and ***xbldt*** protocol.
78
Our solution is to reserve the original *UEFI FD* region in XBL's memory map, find the addresses in decompile tool, then provide these protocols again.
89
___
910

@@ -37,20 +38,20 @@ ___
3738
- Waiting Decompile finish.
3839
- Press `Alt+B`.
3940
- Type `E8 E1 06 3A F6 61 EB 11 BB ED 4B 47 6E 2F F6 A7`, Click **OK**.
40-
<img src="/PortingGuides/Resources/FindProtocolAddressesForKailua/IDABinarySearch.png" width=80%/>
41+
<img src="/PortingGuides/Resources/FindProtocolAddresses/IDABinarySearch.png" width=80%/>
4142
- Double Click the only result, the tool will jump to IDA `View-A`.
4243
- Click the label (e.g. *unk_A703B290*), then press `x`, Click **OK**.
43-
<img src="/PortingGuides/Resources/FindProtocolAddressesForKailua/IDAXrefs.png" width=80%/>
44+
<img src="/PortingGuides/Resources/FindProtocolAddresses/IDAXrefs.png" width=80%/>
4445
- Select the instruction that 2 instractions before *ADRL X0,unk_A703B290*(it is *ADRL X8, unk_A703B0C8* here.).
45-
<img src="/PortingGuides/Resources/FindProtocolAddressesForKailua/IDAViewASecDTB.png" width=80%/>
46+
<img src="/PortingGuides/Resources/FindProtocolAddresses/IDAViewASecDTB.png" width=80%/>
4647
- Copy *A703B0C8* to your note book. This is XBL DTB Protocol Address.
4748
- Press `Alt+B`.
4849
- Type `8D BD C2 8E D7 56 EF 49 87 96 63 17 78 F8 EB F8` and Click **OK**.
4950
- Use the same way you just done, then you'll find the address for Schedule Protocol.
5051
5152
4. Fill address in your device's PcdsFixedAtBuild.dsc.inc.
5253
- Here gives an example.
53-
<img src="/PortingGuides/Resources/FindProtocolAddressesForKailua/PcdsFixedAtBuildSample.png" width=80%/>
54+
<img src="/PortingGuides/Resources/FindProtocolAddresses/PcdsFixedAtBuildSample.png" width=80%/>
5455

5556
## Notice & Issues
5657
- Fix address here may cause some issues.

PortingGuides/Resources/FindProtocolAddressesForKailua/GhidraAfterImporting.png renamed to PortingGuides/Resources/FindProtocolAddresses/GhidraAfterImporting.png

File renamed without changes.

PortingGuides/Resources/FindProtocolAddressesForKailua/GhidraAnalyze.png renamed to PortingGuides/Resources/FindProtocolAddresses/GhidraAnalyze.png

File renamed without changes.

PortingGuides/Resources/FindProtocolAddressesForKailua/GhidraAnalyzeOptions.png renamed to PortingGuides/Resources/FindProtocolAddresses/GhidraAnalyzeOptions.png

File renamed without changes.

PortingGuides/Resources/FindProtocolAddressesForKailua/GhidraImportXBLCore.png renamed to PortingGuides/Resources/FindProtocolAddresses/GhidraImportXBLCore.png

File renamed without changes.

PortingGuides/Resources/FindProtocolAddressesForKailua/GhidraNewProject.png renamed to PortingGuides/Resources/FindProtocolAddresses/GhidraNewProject.png

File renamed without changes.

0 commit comments

Comments
 (0)