Commit Graph

65 Commits

Author SHA1 Message Date
Lily Tsuru 4f6ec38f22 misc fun changes 2023-08-05 06:46:56 -04:00
Lily Tsuru a5f7735d9a lucore: add Unique and Ref types
These alias the standard library unique_ptr and shared_ptr

riscv: Use Unique in many places
Uses lucore::Unique. This should hopefully help memory management somewhat.

lcpu: Use Unique
riscv::System::Create now creates a Unique

so does lucore::Library::OpenExisting
2023-08-02 05:30:18 -04:00
Lily Tsuru 92a62322f9 projgen: Working!
The test-gmod project now builds without any hand-written Makefile, building it by using projgen to generate a makefile then make to build it now works!

I'm pretty happy with it, there's a couple things I might want to fix/add, but for now it's functionally ready.

Now I can probably focus on building a Containerfile for the build image.
2023-07-30 23:44:24 -04:00
Lily Tsuru 568064068e projgen: Initial commit
This commit adds `projgen`, a very simplistic project generator.

Some knobs to the build system were added to ensure that only the
needed parts will build with each end (building the GMod module won't build projgen
since that isn't needed on the host)

The fun part will be figuring out how to jail things properly
2023-07-30 06:58:02 -04:00
Lily Tsuru 5f7f36296f lcpu: make build_module take in the path to the gameserver 2023-07-29 17:02:03 -04:00
Lily Tsuru 7ae6acfc3b lcpu: officially support legacy 32bit branch
32-bit builds using the development headers work on the legacy 32-bit branch so I don't really see a reason to not support it..

sure, it sucks that I now won't be able to get rid of a pretty gnarly codepath, but /shrug
2023-07-29 16:59:51 -04:00
Lily Tsuru 6eada83eeb lcpu/lua: Add Wiremod interface
Another thing checked off the todo list!

Now all I really need to do is uploading (maybe get to work on the project system too?)

This removes the lua test device since it was just that - a test
2023-07-29 01:56:19 -04:00
Lily Tsuru d3cee95b14 lcpu/lua: Move Lua device implementations into seperate "LCPU.Devices" namespace 2023-07-28 18:12:27 -04:00
Lily Tsuru 8eb4b6ef41 lcpu: Misc cleanup
LuaDevice now works fully, without any weird bugs. Yay!
This took quite a bit of bugstomping to arrive to; some of which ended up discovering I'm not particularly proud of doing. Oops!

The LuaCpu implementation no longer has a UART implementation in C++ (which actually leaked everytime a LuaCpu was garbage collected... Yeesh) - instead the Lua entity code actually implements the UART! Pretty cool to see the fruits of my labor actually working!

The LuaHelpers macros are renamed slightly to make them less of a pain (and also because I think having `_IMPLEMENT` in a function implementation is a bit stupid.)

I have updated the ideas document to better reflect my plans for the project system.
2023-07-28 06:05:58 -04:00
Lily Tsuru bdd6839fa2 lcpu/lua: remove "rapid iteration" test code 2023-07-27 17:11:26 -04:00
Lily Tsuru c9968a0954 yet more cleanup 2023-07-27 17:04:56 -04:00
Lily Tsuru 1d0830160b fixup luadevice binding a bit 2023-07-27 16:55:29 -04:00
Lily Tsuru edc5def251 forgot that 2023-07-27 16:38:28 -04:00
Lily Tsuru 14614a72d3 lcpu: Remove TestObject entirely 2023-07-27 16:38:01 -04:00
Lily Tsuru b5595cc996 lcpu: Move LuaCpu to LuaObject 2023-07-27 16:36:08 -04:00
Lily Tsuru deadeb5c51 Move LuaDevice to LuaObject 2023-07-27 16:30:59 -04:00
Lily Tsuru df8647525b move LuaObject into a new source file and clean it up a bit 2023-07-27 16:22:03 -04:00
Lily Tsuru 4538cd182d lcpu: more cleanup. this is the last one I promise, I need sleep 2023-07-27 07:21:04 -04:00
Lily Tsuru 1b347eecc8 lcpu: Cleanup, and begin the implementation of a new system for Lua binding
I didn't like how I did it before, and I don't like how right now everything binds a bit differently.

So let's unify it using the way I like (from the LuaDevice binding)!
2023-07-27 07:16:39 -04:00
Lily Tsuru 40c539bf22 lcpu: Lua devices now work!!
now i can like, actually finish this thing

i will probably commonize all the stuff the luadevice class is doing right now into its own object, since I think that it would be very useful to have elsewhere. but for now it's not common :(
2023-07-27 06:03:28 -04:00
Lily Tsuru b6d41d33fa lcpu: Load lua_shared (I'll probably be replacing ILuaBase usage with this) 2023-07-26 03:08:44 -04:00
Lily Tsuru 9c5415c061 more lua binding fun 2023-07-25 06:46:52 -04:00
Lily Tsuru c69dc8d753 lcpu: FINALLY begin implementing the addon!! 2023-07-24 20:17:07 -04:00
Lily Tsuru 887b66bbb0 test lua binding things 2023-07-24 06:50:18 -04:00
Lily Tsuru 90e684e1e3 riscv: implement syscon + system hooks
This finally allows the test harness to cleanly shut down. Awesome!

This commit also reformats the whole project's native code. Oops!
2023-07-24 01:56:50 -04:00
Lily Tsuru 7af85f5601 riscv: misc code cleanup (now I can actually focus on stuff!) 2023-07-24 00:20:40 -04:00
Lily Tsuru 878990a921 riscv: IT WORKS
finally. once i'm sure it's 100% working i can probably like, develop this addon finally
2023-07-24 00:01:39 -04:00
Lily Tsuru 38e7fc4646 no one will know the pain i go through 2023-07-23 18:13:03 -04:00
Lily Tsuru abe9b78b1a oops 2023-07-23 05:24:26 -04:00
Lily Tsuru 6727ae765b update readme to reflect move to cwgit 2023-07-23 05:22:32 -04:00
Lily Tsuru cd684e1f3e wow holy shit lily finally figured out how to work on the cpu core!
In all seriousness, this commit is a major milestone; insofar that it is
the first time I can actually work on the CPU core.
2023-07-23 05:19:08 -04:00
Lily Tsuru 09b1969d22 riscv: actually, CLINT allows reading the match registers! 2023-07-22 22:46:36 -04:00
Lily Tsuru aa66a1ff2e riscv: Implement partial CLINT and SYSCON. 2023-07-22 22:43:49 -04:00
Lily Tsuru 6a3170dc5c Remove all special treatment of the CPU class 2023-07-21 06:38:42 -04:00
Lily Tsuru 8eaf05a8ac riscv: Heavy bus refactor.
It now doesn't assume literally every device would map something to memory.

This should also fix some API orthogonality issues (ergo the CPU being treated specially)
2023-07-21 06:32:04 -04:00
Lily Tsuru a85a8ddc97 add helper to build module and install it. 2023-07-19 06:31:07 -04:00
Lily Tsuru fb29336ca7 God dman it 2023-07-19 03:20:14 -04:00
Lily Tsuru 70d90d4879 oops 2023-07-19 03:19:39 -04:00
Lily Tsuru 16ac661643 cleanup 2023-07-19 03:18:34 -04:00
Lily Tsuru e3ffcb02c2 revert loggingsystem usage until I feel safe requiring x64 gmod 2023-07-18 23:33:30 -04:00
Lily Tsuru 0d6646f8cb switch to Tier0 LoggingSystem_* 2023-07-18 17:38:33 -04:00
Lily Tsuru 3d9f9139ff move stdout sink to seperate source files 2023-07-18 06:08:49 -04:00
Lily Tsuru 9260acce31 oops 2023-07-18 06:01:32 -04:00
Lily Tsuru cd1a80e4e4 static link libstdc++ because it doesnt work if i dont... 2023-07-18 06:00:04 -04:00
Lily Tsuru c59dcfc614 Implement tier0 library logging bettererer 2023-07-18 05:48:59 -04:00
Lily Tsuru 55eb398b1c cut off lucore test 2023-07-18 02:08:00 -04:00
Lily Tsuru 9d7ef71d3b RamDevice is public
start skeleton gmod module
2023-07-18 02:05:39 -04:00
Lily Tsuru 6ebebae770 Use an output iterator for the lucore stdout sink 2023-07-18 00:47:10 -04:00
Lily Tsuru 58ee03c249 vastly improve logger 2023-07-17 16:27:27 -04:00
Lily Tsuru 22796b69bf implement a basic logger as a part of lucore
I could have implemented a spdlog sink, however spdlog isn't setup for standard format header being a thing yet.

This also introduces a temporary executable target for my own testing of lucore utilities.
2023-07-17 06:59:20 -04:00