Author Topic: KnightOS  (Read 186270 times)

0 Members and 1 Guest are viewing this topic.

SirCmpwn

  • Guest
Re: KnightOS
« Reply #255 on: October 23, 2010, 11:25:32 am »
Well, you have to get the Semaphore object across threads, which is harder :P

Offline Ranman

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1354
  • Rating: +83/-0
    • View Profile
Re: KnightOS
« Reply #256 on: October 23, 2010, 11:38:17 am »
Well, you have to get the Semaphore object across threads, which is harder :P
A semapore is an object managed by the kernel and you can get that object by passing an ID of some sort to a call such as:

CreateSemaphore(int semID, Semaphore* semaphore);

Like you said... calcs have limited resources. You could define a fixed number of semaphores in your kernel. Then each task could register for a semaphore with the CreateSemaphore API. So... 2 (or more) tasks could register for the same semaphore and use the ReleaseSemaphore/WaitForSemaphore APIs to effectively sync with each other.

Piece of cake :P
« Last Edit: October 23, 2010, 11:48:23 am by Ranman »
Ranman
Bringing Randy Glover's Jumpman to the TI-89 calculator. Download available at Ticalc.

SirCmpwn

  • Guest
Re: KnightOS
« Reply #257 on: October 23, 2010, 12:57:56 pm »
Lol sure... I think the ThreadID works well as a semaphore.  Do you have a link to some docs on this?

Offline Ranman

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1354
  • Rating: +83/-0
    • View Profile
Re: KnightOS
« Reply #258 on: October 23, 2010, 01:24:30 pm »
Lol sure... I think the ThreadID works well as a semaphore.  Do you have a link to some docs on this?
I'll see if I can come up with some docs for you.

Each thread (or task) would have its own unique ID and each semaphore would have its own unique ID. That way two independent threads can utilize the same semaphore for syncing purposes -- so I don't think using thread ID as a sem ID would be a good idea for this reason.

edit: here is a link to the VxWorks reference manual. Take a look at the semLib chapter.

http://www.sls.psi.ch/controls/help/howto/vxworksHOWTO/VxWorks_Ref_Man.pdf
« Last Edit: October 23, 2010, 01:44:12 pm by Ranman »
Ranman
Bringing Randy Glover's Jumpman to the TI-89 calculator. Download available at Ticalc.

SirCmpwn

  • Guest
Re: KnightOS
« Reply #259 on: October 23, 2010, 02:52:42 pm »
Well, I was thinking ThreadLock (ID) and ThreadRelease (ID) and WaitRelease (wait for thread to be released from a lock, even when unlocked).  And creating threads returns an ID, so the locking thread has that.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: KnightOS
« Reply #260 on: October 23, 2010, 03:25:21 pm »
What happens if two threads try and access the same thing at the same time?

SirCmpwn

  • Guest
Re: KnightOS
« Reply #261 on: October 23, 2010, 03:26:10 pm »
Nothing special.  Technically, it won't be at the same time without multiple cores, which the calculator does not have.

Offline mapar007

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 550
  • Rating: +28/-5
  • The Great Mata Mata
    • View Profile
Re: KnightOS
« Reply #262 on: October 23, 2010, 03:55:42 pm »
Nothing special.  Technically, it won't be at the same time without multiple cores, which the calculator does not have.
* mapar007 runs to Kerm to tell him to implement multi-core in his next ultimate calc project.


Nice to see the project is coming along (I don't visit that often anymore, sadly...). About semaphores: would that actually be necessary in this context? If the kernel routines use too much 'modern' access control, wouldn't that cause huge lags?


EDIT: oh, something to that effect has been stated already. Sorry to bother.
« Last Edit: October 23, 2010, 03:56:24 pm by mapar007 »

SirCmpwn

  • Guest
Re: KnightOS
« Reply #263 on: October 23, 2010, 04:11:21 pm »
No problem.  I'm keeping this minimalistic, there really isn't very much processing power to go around.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: KnightOS
« Reply #264 on: October 23, 2010, 04:17:24 pm »
You're still keeping this TI-73/83+ compatible, right?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

SirCmpwn

  • Guest
Re: KnightOS
« Reply #265 on: October 23, 2010, 04:18:30 pm »
83+, yes.  73, maybe.  The 73 has never been a goal.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: KnightOS
« Reply #266 on: October 23, 2010, 04:55:44 pm »
Ah ok. I thought it might be 73 compatible since it barely requires much modifications if I remember. Not really that necessary, though, as very few people use the TI-73. (even less than the 81, if I remember). It's only sold in USA, too.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6265
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: KnightOS
« Reply #267 on: October 24, 2010, 09:24:07 pm »

Hmm, maybe I'm working on porting my console to KOS's filesystem, maybe not ;P
« Last Edit: October 24, 2010, 09:24:55 pm by Eeems »
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: KnightOS
« Reply #268 on: October 24, 2010, 09:28:34 pm »
That looks nice. That lines that gets deleted very fast it's CLEAR, right? Otherwise it might be good to make sure key sensitiveness isn't too high.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

SirCmpwn

  • Guest
Re: KnightOS
« Reply #269 on: October 24, 2010, 09:33:15 pm »
*slowly
:P
That's right folks, this is a program running under KnightOS :)
Nice work Eeems!