King Harold wrote:But Tim, what I meant by making the thread switcher "callable" is that you could call it as though it were a "sleep(0)" call ensuring that other threads would get a chance to run - if there any (if not, the CPU time taken up doesn't bother any thread) and resetting the counter thingy used for priorities or whatever (assuming you have such a thing)
I don't really see a use for priorities here, so I'd rather keep away from them if possible
And if there's just one process just handing control back in every time it gets CPU control, perhaps we could do something like a "soft APD" where the OS goes into low power consumption mode, while still calling the thread(s) once in a while. That way it could "revive" the calculator when it receives incoming data or whatnot
Code: Select all
.org 0
jp startup
.org $53 ;bootcode seems to check for this
jp startup
.db $5A,$A5
startup:
;you could initialize the hardware..
;but why would you if you're not going to use it..
;no code here - which means $FF opcodes, which is RST $38
;what would be the interrupt routine will keep calling itself
Shouldn't you also initialize some code at $0038 then?
Or you could keep it in im 0, of course.
Demon wrote:Isn't that a good thing? There'd be less work to do, development would go by faster, and there'd be something for everyone to play with sooner.
The development IS most of the playing
Anyway, the main reason is that I don't expect him to want to help another project when he's working on his own, and we can't really join his if we want to code in C.
driesguldolf wrote:The .orgs are to support the use of rst ##h calls, you can put some small very usefull routines there
Yes, I saw Jim do that, but what the hell is the use? Why not just use call? What does rst do really? Being a Ti-83 guy myself I've never really seen the point in bcall
Thinking of apps, If you want everything to directly run from the flash means that every program has to be (minimum) 16Kb in size
Is that so? I don't think that's necessarily true. I know you can only reset the flash one page at a time, but I think some smart flash file system should be able to abstract that from the rest of the system, and allow for storing as many files as will fit in a flash page. In other words:
King Harold wrote:I wonder about fwrite() though, what should the driver do when you're trying to do that with an archived file?
Buffer the entire file in RAM and write back when closed?
Yes, something like that
@Ben: I'll see if I can find the time to read up on the boot process some time soon, thanks for the pointers.
On the subject of using the flash as a file system and the RAM for variables and whatnot, I guess I should copy paste what I wrote last night so you get an idea of what I want.
Memory usage
I want to use the flash as file storage and keep the entire RAM free for programs to use, with the kernel giving out pieces of RAM to programs that do a malloc (NO SWAPPING to flash though, or we'll wear the flash out real soon - if we're out of memory we're out of memory). I think we could perhaps even do with the overhead of letting the kernel access the RAM instead of the program, to ensure that threads don't go overwriting each other's memory (we should at least somehow ensure that the kernel threads are safe, preferably by keeping them in flash and not requiring any RAM, just using local variables on the stack and in the registers). Accessing the file system (the flash memory) should be the territory of the kernel.
Huge amounts of "saferams" combined with programming in C instead of tedious assembly, should give programmers incredible flexibility in what they can write. Also, in the more distant future, it could allow for "Ti-OS simulation" by allocating all the saferam areas and putting function hooks in the right places before running assembly programs that were originally intended for the original OS. Such a thing could greatly increase it's popularity.
benryves wrote:You talk about a file-system; this was the thing that put me off such an OS project.
Are you going to make such a thing modular
Yeah, me too. But I've found a guy who's already done something similar I think. Should contact him soon
I'd prefer a nicely modular file system that, as you say, can be used for USB storage devices, network mounts and whatnot, but let's start with something working
Okay, I'm off. I'll be back after the weekend
Nice to see some discussion on the right topics this time! Says a few good things about the level of maturity of Maxcoderz compared to UTI where this sprouted last time