Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic userspace allocator #544

Merged
merged 10 commits into from
Nov 20, 2023
Merged

Add basic userspace allocator #544

merged 10 commits into from
Nov 20, 2023

Conversation

vinc
Copy link
Owner

@vinc vinc commented Nov 18, 2023

This PR continues the work started a year and a half ago here: #353

@vinc
Copy link
Owner Author

vinc commented Nov 18, 2023

Demo:

~
> print "Hello, World!"
Hello, World!

~
> hello
Hello, World!

~
> hello "Alice"
Alice
DEBUG: syscall::alloc(size=7, align=1) -> ptr=0x444446d3a010
DEBUG: syscall::alloc(size=14, align=1) -> ptr=0x444446d3a020
DEBUG: syscall::free(ptr=0x444446d3a010, size=7, align=1)
Hello, Alice!
DEBUG: syscall::free(ptr=0x444446d3a020, size=14, align=1)

Not everything work yet, for example if we don't print the Alice arg first, the string concatenation doesn't work and Alice don't get printed the second time, without causing any error.

@vinc
Copy link
Owner Author

vinc commented Nov 18, 2023

If we write the first Alice in the demo above to stdnull instead of stdout the demo still work. But it's not simply the conversion of the str into bytes and then the split into ptr and len that happen before the actual syscall.

@vinc vinc changed the title Add userspace allocator Add basic userspace allocator Nov 20, 2023
@vinc vinc marked this pull request as ready for review November 20, 2023 19:36
@vinc
Copy link
Owner Author

vinc commented Nov 20, 2023

Some issues remain but we'll merge this to implement what is needed for a basic userspace shell.

@vinc vinc merged commit b4b3b0f into trunk Nov 20, 2023
1 check passed
@vinc vinc deleted the feature/userspace-allocator branch November 20, 2023 19:44
@vinc vinc mentioned this pull request Nov 20, 2023
@vinc vinc mentioned this pull request Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant