-
Notifications
You must be signed in to change notification settings - Fork 70
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
sqlite: Initial port #417
Open
msdx321
wants to merge
22
commits into
gwsystems:loader
Choose a base branch
from
msdx321:sqlite
base: loader
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
sqlite: Initial port #417
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
a2c3566
libc: Fix library output name
msdx321 cd5b02f
posix: Nuke SL
msdx321 0707a4c
lib: sqlite: Initial import
msdx321 1ea129f
sqlite: Update to latest
msdx321 8c79591
sqlite_tests: Add initial test
msdx321 9d9dc43
.gitmodules: Update
msdx321 cccfa82
libc: Fix compile
msdx321 dac0a2b
capmgr: Return mapped mem properly
msdx321 564b08d
ps: Set to my fork
msdx321 0a8176a
posix: Make it work for now
msdx321 2690e4f
blockdev: Add blockdev interface
msdx321 e8581ad
blockdev: Add ramdisk implementation
msdx321 89da24f
ramdisk: Add a small test
msdx321 dd5410f
filesystem: Add filesystem interface
msdx321 0ee4ec1
filesystem: Add ext4 implementation
msdx321 0adc138
ext4: Add a small test
msdx321 f9914ab
lwext4: Add as a lib
msdx321 0b7f9e4
.gitignore: Update
msdx321 2fddd37
Merge branch 'loader' into filesystem
msdx321 f8adc21
Merge branch 'loader' into sqlite
msdx321 e6ea277
Merge branch 'filesystem' into sqlite
msdx321 7c5069d
ps: Fix merge error
msdx321 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
[submodule "src/components/lib/ps/ps"] | ||
path = src/components/lib/ps/ps | ||
url = https://github.com/gwsystems/ps.git | ||
url = https://github.com/msdx321/ps.git | ||
[submodule "src/components/lib/ck/ck"] | ||
path = src/components/lib/ck/ck | ||
url = https://github.com/gwsystems/ck.git | ||
[submodule "src/components/lib/sqlite/sqlite"] | ||
path = src/components/lib/sqlite/sqlite | ||
url = https://github.com/msdx321/sqlite.git | ||
[submodule "src/components/lib/lwext4/lwext4"] | ||
path = src/components/lib/lwext4/lwext4 | ||
url = https://github.com/msdx321/lwext4.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[system] | ||
description = "Simplest system with both capability manager and scheduler, from unit_schedcomp.sh" | ||
|
||
[[components]] | ||
name = "booter" | ||
img = "no_interface.llbooter" | ||
implements = [{interface = "init"}, {interface = "addr"}] | ||
deps = [{srv = "kernel", interface = "init", variant = "kernel"}] | ||
constructor = "kernel" | ||
|
||
[[components]] | ||
name = "capmgr" | ||
img = "capmgr.simple" | ||
deps = [{srv = "booter", interface = "init"}, {srv = "booter", interface = "addr"}] | ||
implements = [{interface = "capmgr"}, {interface = "init"}, {interface = "memmgr"}, {interface = "capmgr_create"}] | ||
constructor = "booter" | ||
|
||
[[components]] | ||
name = "sched" | ||
img = "sched.root_fprr" | ||
deps = [{srv = "capmgr", interface = "init"}, {srv = "capmgr", interface = "capmgr"}, {srv = "capmgr", interface = "memmgr"}] | ||
implements = [{interface = "sched"}, {interface = "init"}] | ||
constructor = "booter" | ||
|
||
[[components]] | ||
name = "blockdev" | ||
img = "blockdev.ramdisk" | ||
deps = [{srv = "sched", interface = "init"}, {srv = "capmgr", interface = "capmgr_create"}, {srv = "capmgr", interface = "memmgr"}] | ||
implements = [{interface = "blockdev"}] | ||
constructor = "booter" | ||
|
||
[[components]] | ||
name = "filesystem" | ||
img = "filesystem.ext4" | ||
deps = [{srv = "sched", interface = "init"}, {srv = "capmgr", interface = "capmgr_create"}, {srv = "blockdev", interface = "blockdev"}, {srv = "capmgr", interface = "memmgr"}] | ||
implements = [{interface = "filesystem"}] | ||
constructor = "booter" | ||
|
||
[[components]] | ||
name = "ext4_tests" | ||
img = "tests.ext4_tests" | ||
deps = [{srv = "sched", interface = "init"}, {srv = "capmgr", interface = "capmgr_create"}, {srv = "filesystem", interface = "filesystem"}, {srv = "capmgr", interface = "memmgr"}] | ||
constructor = "booter" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[system] | ||
description = "Simplest system with both capability manager and scheduler, from unit_schedcomp.sh" | ||
|
||
[[components]] | ||
name = "booter" | ||
img = "no_interface.llbooter" | ||
implements = [{interface = "init"}, {interface = "addr"}] | ||
deps = [{srv = "kernel", interface = "init", variant = "kernel"}] | ||
constructor = "kernel" | ||
|
||
[[components]] | ||
name = "capmgr" | ||
img = "capmgr.simple" | ||
deps = [{srv = "booter", interface = "init"}, {srv = "booter", interface = "addr"}] | ||
implements = [{interface = "capmgr"}, {interface = "init"}, {interface = "memmgr"}, {interface = "capmgr_create"}] | ||
constructor = "booter" | ||
|
||
[[components]] | ||
name = "sched" | ||
img = "sched.root_fprr" | ||
deps = [{srv = "capmgr", interface = "init"}, {srv = "capmgr", interface = "capmgr"}, {srv = "capmgr", interface = "memmgr"}] | ||
implements = [{interface = "sched"}, {interface = "init"}] | ||
constructor = "booter" | ||
|
||
[[components]] | ||
name = "blockdev" | ||
img = "blockdev.ramdisk" | ||
deps = [{srv = "sched", interface = "init"}, {srv = "capmgr", interface = "capmgr_create"}, {srv = "capmgr", interface = "memmgr"}] | ||
implements = [{interface = "blockdev"}] | ||
constructor = "booter" | ||
|
||
[[components]] | ||
name = "ramdisk_tests" | ||
img = "tests.ramdisk_tests" | ||
deps = [{srv = "sched", interface = "init"}, {srv = "capmgr", interface = "capmgr_create"}, {srv = "blockdev", interface = "blockdev"}, {srv = "capmgr", interface = "memmgr"}] | ||
constructor = "booter" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[system] | ||
description = "Simple test of sqlite." | ||
|
||
[[components]] | ||
name = "booter" | ||
img = "no_interface.llbooter" | ||
implements = [{interface = "init"}, {interface = "addr"}] | ||
deps = [{srv = "kernel", interface = "init", variant = "kernel"}] | ||
constructor = "kernel" | ||
|
||
[[components]] | ||
name = "capmgr" | ||
img = "capmgr.simple" | ||
deps = [{srv = "booter", interface = "init"}, {srv = "booter", interface = "addr"}] | ||
implements = [{interface = "capmgr"}, {interface = "init"}, {interface = "memmgr"}, {interface = "capmgr_create"}] | ||
constructor = "booter" | ||
|
||
[[components]] | ||
name = "sched" | ||
img = "sched.root_fprr" | ||
deps = [{srv = "capmgr", interface = "init"}, {srv = "capmgr", interface = "capmgr"}, {srv = "capmgr", interface = "memmgr"}] | ||
implements = [{interface = "sched"}, {interface = "init"}] | ||
constructor = "booter" | ||
|
||
[[components]] | ||
name = "sqlite_tests" | ||
img = "tests.sqlite_tests" | ||
deps = [{srv = "sched", interface = "init"}, {srv = "sched", interface = "sched"}, {srv = "capmgr", interface = "capmgr_create"}, {srv = "capmgr", interface = "memmgr"}, {srv = "capmgr", interface = "capmgr"}] | ||
constructor = "booter" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Required variables used to drive the compilation process. It is OK | ||
# for many of these to be empty. | ||
# | ||
# The set of interfaces that this component exports for use by other | ||
# components. This is a list of the interface names. | ||
INTERFACE_EXPORTS = blockdev | ||
# The interfaces this component is dependent on for compilation (this | ||
# is a list of directory names in interface/) | ||
INTERFACE_DEPENDENCIES = memmgr | ||
# The library dependencies this component is reliant on for | ||
# compilation/linking (this is a list of directory names in lib/) | ||
LIBRARY_DEPENDENCIES = component | ||
# Note: Both the interface and library dependencies should be | ||
# *minimal*. That is to say that removing a dependency should cause | ||
# the build to fail. The build system does not validate this | ||
# minimality; that's on you! | ||
|
||
include Makefile.subdir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Required variables used to drive the compilation process. It is OK | ||
# for many of these to be empty. | ||
# | ||
# The set of interfaces that this component exports for use by other | ||
# components. This is a list of the interface names. | ||
INTERFACE_EXPORTS = blockdev | ||
# The interfaces this component is dependent on for compilation (this | ||
# is a list of directory names in interface/) | ||
INTERFACE_DEPENDENCIES = memmgr | ||
# The library dependencies this component is reliant on for | ||
# compilation/linking (this is a list of directory names in lib/) | ||
LIBRARY_DEPENDENCIES = component | ||
# Note: Both the interface and library dependencies should be | ||
# *minimal*. That is to say that removing a dependency should cause | ||
# the build to fail. The build system does not validate this | ||
# minimality; that's on you! | ||
|
||
include Makefile.subsubdir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## blockdev | ||
|
||
This is the skeleton interface used by the `mkcomponent.sh` script to aid in the creation of a new component. | ||
It provides no functionality, and should never be depended on! | ||
This documentation should be *replaced* in the documentation for a new component. | ||
|
||
### Description | ||
|
||
### Usage and Assumptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include <cos_component.h> | ||
#include <llprint.h> | ||
#include <memmgr.h> | ||
|
||
#define BLOCKDEV_RAMDISK_BSIZE 4096 | ||
#define BLOCKDEV_RAMDISK_SIZE 16 * 1024 * 1024 | ||
|
||
typedef struct block { | ||
char c[BLOCKDEV_RAMDISK_BSIZE]; | ||
} blk; | ||
|
||
blk *ram_backend; | ||
|
||
unsigned int | ||
blockdev_bread(void *buf, unsigned long offset, unsigned long length) | ||
{ | ||
memcpy(buf, &ram_backend[offset], length * BLOCKDEV_RAMDISK_BSIZE); | ||
return 0; | ||
} | ||
|
||
unsigned int | ||
blockdev_bwrite(const void *buf, unsigned long offset, unsigned long length) | ||
{ | ||
memcpy(&ram_backend[offset], buf, length * BLOCKDEV_RAMDISK_BSIZE); | ||
return 0; | ||
} | ||
|
||
void | ||
cos_init(void) | ||
{ | ||
ram_backend = (blk *)memmgr_heap_page_allocn(BLOCKDEV_RAMDISK_SIZE / 4096); | ||
return; | ||
} | ||
|
||
void | ||
cos_parallel_init(coreid_t cid, int init_core, int ncores) | ||
{ | ||
return; | ||
} | ||
|
||
void | ||
parallel_main(coreid_t cid) | ||
{ | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Required variables used to drive the compilation process. It is OK | ||
# for many of these to be empty. | ||
# | ||
# The set of interfaces that this component exports for use by other | ||
# components. This is a list of the interface names. | ||
INTERFACE_EXPORTS = filesystem | ||
# The interfaces this component is dependent on for compilation (this | ||
# is a list of directory names in interface/) | ||
INTERFACE_DEPENDENCIES = blockdev | ||
# The library dependencies this component is reliant on for | ||
# compilation/linking (this is a list of directory names in lib/) | ||
LIBRARY_DEPENDENCIES = component | ||
# Note: Both the interface and library dependencies should be | ||
# *minimal*. That is to say that removing a dependency should cause | ||
# the build to fail. The build system does not validate this | ||
# minimality; that's on you! | ||
|
||
include Makefile.subdir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Required variables used to drive the compilation process. It is OK | ||
# for many of these to be empty. | ||
# | ||
# The set of interfaces that this component exports for use by other | ||
# components. This is a list of the interface names. | ||
INTERFACE_EXPORTS = filesystem | ||
# The interfaces this component is dependent on for compilation (this | ||
# is a list of directory names in interface/) | ||
INTERFACE_DEPENDENCIES = blockdev memmgr | ||
# The library dependencies this component is reliant on for | ||
# compilation/linking (this is a list of directory names in lib/) | ||
LIBRARY_DEPENDENCIES = component lwext4 posix libc ps | ||
# Note: Both the interface and library dependencies should be | ||
# *minimal*. That is to say that removing a dependency should cause | ||
# the build to fail. The build system does not validate this | ||
# minimality; that's on you! | ||
|
||
include Makefile.subsubdir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## filesystem | ||
|
||
This is the skeleton interface used by the `mkcomponent.sh` script to aid in the creation of a new component. | ||
It provides no functionality, and should never be depended on! | ||
This documentation should be *replaced* in the documentation for a new component. | ||
|
||
### Description | ||
|
||
### Usage and Assumptions |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want to move this into gwsystems. Remember, we want the main branch of the repo be unmodifed, and have a
cos
branch that we pull in as a submodule. That way we have a path for updating the code as upstream changes.