Giter Club home page Giter Club logo

Comments (4)

quite avatar quite commented on June 11, 2024

@mchack-work
I've worked on this today. Draft PRs here #40 and tillitis/tkey-ssh-agent#18

I'm trying 8 kb stack, and it mostly works. The issue I see is that the setup of new stack doesn't seem to bite. https://github.com/tillitis/tillitis-key1-apps/pull/18/files#diff-3857988385a284fb03dc747adb79566dac6d15e071f51256f9a7e702e4208d62R84

li sp, NEW_STACK might not be enough? The second time the program puts &stack, the addr is the same as the first. Some proper relocation needed? But how?

Might there then be other issues due to not doing proper relocation? I'm not so familar with riscv addressing yet, could there be address references that needs to be relocated? But the jump to forever_ledflash() works at least...

from tillitis-key1.

mchack-work avatar mchack-work commented on June 11, 2024

We probably can't do any relocation as inline assembler. If so, we're messing with the C runtime.

In our relocation example we want to run the relocation before starting running C code. This probably means linking with another libcrt0 if people want support for relocation.

I think it's more important to allow for larger device apps (make the stack smaller) than thinking about dynamic relocation.

from tillitis-key1.

quite avatar quite commented on June 11, 2024

Ah yes, I tried my hand at accomplishing relocation by having a different app.lds and crt0.S. Relocating the init crt0 at 0x40002000 and the app C main at 0x40010000. Setting the stack below that in crt0.S. It almost worked, except the call main ended up executing a jump to 0x40012000 -- too high. But it feels like this could be possible, just have to get the lds script right.

I think I'll leave the example app outside scope of this issue. And also settle on 16 kb stack, 8 seems a bit too small

from tillitis-key1.

quite avatar quite commented on June 11, 2024

Closed with these:
tillitis/tkey-ssh-agent#18
#40

from tillitis-key1.

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.