GithubHelp home page GithubHelp logo

Comments (7)

Princess-of-Sleeping avatar Princess-of-Sleeping commented on July 23, 2024

Call ksceKernelAllocMemBlock with Settings VA to option.field_C and ATTR_VBASE to option.attr

#define ATTR_VBASE (1)

from vita-headers.

Princess-of-Sleeping avatar Princess-of-Sleeping commented on July 23, 2024

Also note that the kernel memory cannot be mapped to the user address because the process has its own address space.

Kern memory to User address `0x81010000`: Should failed
User memory to User address `0x81010000`: Should success
User memory to Kern address `0x01200000`: Should failed
Kern memory to Kern address `0x01200000`: Should success

from vita-headers.

jvulcan avatar jvulcan commented on July 23, 2024

Awesome, I'm investigating if I can mimic the available memory regions of the nintendo 3DS.
Because it doesn't expose dynamic addresses for heap, mappable memory, vram, mapped IO, etc.

#define OS_HEAP_AREA_BEGIN 0x08000000 ///< Start of the heap area in the virtual address space
#define OS_HEAP_AREA_END   0x0E000000 ///< End of the heap area in the virtual address space

#define OS_MAP_AREA_BEGIN  0x10000000 ///< Start of the mappable area in the virtual address space
#define OS_MAP_AREA_END    0x14000000 ///< End of the mappable area in the virtual address space

#define OS_OLD_FCRAM_VADDR 0x14000000 ///< Old pre-8.x linear FCRAM mapping virtual address
#define OS_OLD_FCRAM_SIZE  0x8000000  ///< Old pre-8.x linear FCRAM mapping size (128 MiB)

#define OS_QTMRAM_VADDR    0x1E800000 ///< New3DS QTM memory virtual address
#define OS_QTMRAM_SIZE     0x400000   ///< New3DS QTM memory size (4 MiB; last 128 KiB reserved by kernel)

#define OS_MMIO_VADDR      0x1EC00000 ///< Memory mapped IO range virtual address
#define OS_MMIO_SIZE       0x400000   ///< Memory mapped IO range size (4 MiB)

#define OS_VRAM_VADDR      0x1F000000 ///< VRAM virtual address
#define OS_VRAM_SIZE       0x600000   ///< VRAM size (6 MiB)

#define OS_DSPRAM_VADDR    0x1FF00000 ///< DSP memory virtual address
#define OS_DSPRAM_SIZE     0x80000    ///< DSP memory size (512 KiB)

#define OS_KERNELCFG_VADDR 0x1FF80000 ///< Kernel configuration page virtual address
#define OS_SHAREDCFG_VADDR 0x1FF81000 ///< Shared system configuration page virtual address

#define OS_FCRAM_VADDR     0x30000000 ///< Linear FCRAM mapping virtual address
#define OS_FCRAM_SIZE      0x10000000 ///< Linear FCRAM mapping size (256 MiB)

Edit: removed physical addresses because they don't matter

from vita-headers.

jvulcan avatar jvulcan commented on July 23, 2024

Thank you, I will keep researching about this topic further.

from vita-headers.

jvulcan avatar jvulcan commented on July 23, 2024

Call ksceKernelAllocMemBlock with Settings VA to option.field_C and ATTR_VBASE to option.attr

#define ATTR_VBASE (1)

Hello, I can't find "Settings VA" to fill field_C.
my code:

SceKernelAllocMemBlockKernelOpt opt;
opt.size = sizeof(SceKernelAllocMemBlockKernelOpt);
opt.field_C = 0x0; // ???? missing value
opt.attr = romMH4U.textVAddr; // virtual address is 0x100000

SceUID txtHndl = ksceKernelAllocMemBlock("3ds_text", 
SCE_KERNEL_MEMBLOCK_TYPE_KERNEL_RX, // should be kernel right?
romMH4U.textSz, opt);

Checked everything with "settings" in the documentation and I found nothing.
And another thing, why does the Alloc function asks for a name?

Thanks in advance.

from vita-headers.

Princess-of-Sleeping avatar Princess-of-Sleeping commented on July 23, 2024
SceKernelAllocMemBlockKernelOpt opt;
memset(&opt, 0, sizeof(opt));
opt.size = sizeof(opt);
opt.field_C = romMH4U.textVAddr;
opt.attr = ATTR_VBASE;

from vita-headers.

jvulcan avatar jvulcan commented on July 23, 2024

Thanks for the 'memset' note. I forgot to clear this thing in the first place; my c/c++ practical skill is a little rusted.

from vita-headers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.