Custom port A9G module: help wanted

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
pulkin
Posts: 20
Joined: Tue Feb 19, 2019 10:22 pm

Re: Custom port A9G module: help wanted

Post by pulkin » Sat May 25, 2019 6:21 pm

Can you give an example of the code that would cause a root pointer to stuck in the registers? I tried the following one with no success: ptr remains inside the memory.

Code: Select all

void gc_stress_test(void) {
    volatile int delta = 0;
    void* ptr;
    
    // Some significant allocation
    ptr = gc_alloc(400000, 0);
    
    // Make ptr stick around ...
    mp_warning("test", "ptr 0x%p", ptr);
    ptr += delta;
    
    // ... and immidiately call gc_collect ...
    gc_collect();
    
    // ... while preventing ptr to be optimized out
    mp_warning("test", "ptr 0x%p", ptr);
    // gc_dump_info always shows 400000 to be occupied
    gc_dump_info();
}

jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

Re: Custom port A9G module: help wanted

Post by jickster » Sat May 25, 2019 6:49 pm

That’s a difficult thing to replicate because it totally depends on how your compiler generates the binary code aka assembly.

I’m not surprised that you’re having a hard time creating that condition because in most(all?) cases, the registers will be flushed to memory.

But I wouldn’t rely on this otherwise one Day you’ll get a weird bug.

Are you having trouble writing code to root-sweep the registers?


Sent from my iPhone using Tapatalk Pro

pulkin
Posts: 20
Joined: Tue Feb 19, 2019 10:22 pm

Re: Custom port A9G module: help wanted

Post by pulkin » Sat May 25, 2019 7:37 pm

Exactly. I have a code which compiles and runs but since this is my first asm code I have no idea whether it will actually work in the wild.

https://github.com/pulkin/micropython/b ... gchelper.s

pulkin
Posts: 20
Joined: Tue Feb 19, 2019 10:22 pm

Re: Custom port A9G module: help wanted

Post by pulkin » Sun May 26, 2019 6:45 pm

I saw two kinds of SSL/TLS bundled with mp: which one should I compile in?

pulkin
Posts: 20
Joined: Tue Feb 19, 2019 10:22 pm

Re: Custom port A9G module: help wanted

Post by pulkin » Sun Jun 09, 2019 10:14 pm

I need help adding SSL to my module.

Post Reply