Author Topic: All bootparams and their values  (Read 1207 times)

Offline Graphene

  • Refugee
  • **
  • Posts: 91
    • View Profile
All bootparams and their values
« on: April 19, 2020, 03:42:43 PM »
Since DolceSDK now support setting bootparams for applications, I decided to document all bootparams and their values.

1. Differences between "game mode" and "system mode" applications on PS Vita

These are general differences:

"Game mode":

1. Does not support multitasking.
2. "Unlimited" memory budget.
3. Can use only 3 out of 4 CPU cores.
4. Are expected to use normal framebuffer implementation.

"System mode":

1. Support multitasking (several apps of that type can be loaded simultaneosly with each other and with 1 "game mode" app).
2. Limited memory budget.
3. Can use all CPU cores.
4. Are expected to use shared framebuffer.
5. Can NOT use CDRAM.

2. Bootparams

All used bootparams are situated at the start of the bootparams section in the SELF file:



The general functions of these bootparams are:

1. 0x01 - "is used" flag - always set to 1.

2. 0x0000000E - ATTRIBUTE. Controls a lot of application parameters, such as: CPU Affinity mask, process priority, memory types accesible by application etc.
3. 0x001C0000 - PHY_MEMSIZE. Controls how much physically contiguous memory will be allocated to "system mode" application budget.
4. 0x00280100 - APP_MEMSIZE. Controls memory budget for "system mode" application.
6. 0x14 - FILE_OPEN_MAX_NUM. Maximum number of file descriptors opened at the same time.
7. 0x06 - DIRECTORY_MAX_LEVEL. Maximum directory level.
8. 0x04 - ENCRYPT_MOUNT_MAX_NUM. Function is unknown. Related to PFS.
9. 0x04 - REDIRECT_MOUNT_MAX_NUM. Function is unknown. Related to FIOS2.

10. Everything else is reserved area, always set to 0.

If APP_MEMSIZE is set to 0, application will run in "game mode".
If APP_MEMSIZE is set to anything other than 0, application will run in "system mode".


3. Bootparams that you can set for "game mode" applications and their values:

Allowed bootparams:

Only ATTRIBUTE can be set for "game mode" applications.

Values List:

Only one value is allowed: 0x00000002. Function is unknown, set in some apps developed by Sony.

4. Bootparams that you can set for "system mode" applications and their values:

4.1 Allowed bootparams:

All bootparams are allowed

4.2 Values List:

4.2.1 APP_MEMSIZE (all values are little endian)

Smallest seen value: 0x00100000 (4 MB, some BG apps)
.
.
.
Highest seen value: 0x00280100 (74 MB, YouTube app)

Note that applications with APP_MEMSIZE smaller than 0x4000 can be started simultaneously with any game, including enlarged memory mode games, as long as title id check is disabled in SceShell (function of https://github.com/GrapheneCt/LowMemMode).

Note that applications with APP_MEMSIZE bigger than 0x8000 have limited multitasking capabilities.

4.2.2 PHY_MEMSIZE (all values are little endian)

Not used: 0x00000000

Smallest seen value: 0x00100000 (4 MB)
.
.
.
Highest valid value: 0x00680000 (26 MB)

Note that phycont budget is substracted from main budget. For example if APP_MEMSIZE is set to 0x20 (8 MB) and PHY_MEMSIZE is set to 0x10 (4 MB), the resulting application budget will be: 4 MB of main memory and 4 MB of phycont memory.

4.2.3 ATTRIBUTE

Not used: 0x00000000. If set to 0, application is limited to system-reserved core. CPU affinity mask of all new threads within application must be set to 0.



Note: in case your app is allowed to use all CPU cores use following CPU affinity mask values when creating new thread:

/*CPU Affinity mask:
0x00000 - all user cores (auto)
0x80000 - system-reserved core
*/
« Last Edit: July 03, 2020, 12:41:22 AM by Graphene »

Offline Graphene

  • Refugee
  • **
  • Posts: 91
    • View Profile
Re: All bootparams and their values
« Reply #1 on: April 21, 2020, 04:12:20 PM »
Added more bootparams, updated in according to official information from ★Check application.

Offline Graphene

  • Refugee
  • **
  • Posts: 91
    • View Profile
Re: All bootparams and their values
« Reply #2 on: July 03, 2020, 12:40:06 AM »
Updated with info related to file descriptor, dir level and mount points bootparams.