Author Topic: TI-Nspire Task Manager  (Read 12825 times)

0 Members and 1 Guest are viewing this topic.

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
TI-Nspire Task Manager
« on: March 17, 2013, 11:00:48 am »
Yesterday I started to fiddle around with Nucleus OS (the underlying Operating System of the Nspire) and here is the first tool I wrote for it: A Task Manager :P
It shows the currently running tasks, infos about them and it can kill tasks ;D

Currently it only works on classic non-CAS Nspires (it shouldn't be hard to add support for other models, but I am lazy...)
More features will come.

Known tasks:
gui - User Interface. Killing it crashes calc
KPD_TASK, KPT_TASK - Handle keypad input. Killing them makes the keypad unusable
wcm_* - probably related to the wireless cradle?
OffMon - When killed you can't turn the calc off
« Last Edit: March 18, 2013, 08:58:17 am by compu »

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: TI-Nspire Task Manager
« Reply #1 on: March 17, 2013, 11:09:40 am »
Now we can finally kill TI :P Have there been tests at what can and what cannot be safely killed? (with safely being may crash your calc but doesn't/shouldn't corrupt anything). This looks like a nice addition to our toolsets :).
« Last Edit: March 17, 2013, 11:15:53 am by ElementCoder »

Some people need a high five in the face... with a chair.
~EC

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: TI-Nspire Task Manager
« Reply #2 on: March 17, 2013, 11:14:33 am »
Well, I haven't tried it too much, but you shouldn't kill gui because it'll crash your calc ;)
And for some tasks it is hard to find out what they do, either because they have no names, or a name that doesn't say anything about their purpose...

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: TI-Nspire Task Manager
« Reply #3 on: March 17, 2013, 11:17:55 am »
Aww that's too bad, I've always wanted to run it without a GUI, CLI FTW :P I'll look for some batteries and go on a killing spree :)

Some people need a high five in the face... with a chair.
~EC

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: TI-Nspire Task Manager
« Reply #4 on: March 17, 2013, 11:23:24 am »
I haven't tested it on real hardware yet (because CAS is running on my calc and that's not supported atm) so thanks for doing that :)
I don't think killing a task will corrupt or damage anything, but I can't guarantee it (but even if it does, which is unlikely, you can still reflash the OS ;) )

Offline SpiroH

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +153/-23
    • View Profile
Re: TI-Nspire Task Manager
« Reply #5 on: March 17, 2013, 12:01:58 pm »
Excellent!



Offline Dapianokid

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 539
  • Rating: +46/-27
  • That one dude
    • View Profile
Re: TI-Nspire Task Manager
« Reply #6 on: March 17, 2013, 12:24:22 pm »
Maybe wirte a feature that allows you to explore, to a greater extent, the purpose of a task and/or what and/or how it does what it is doing? Monitor the CPU for different things like I/O and the memory section with a viewer for the selected task? A scheduler and a performance monitor, as well as a memory viewer, is always a nice feature :) I give ideas! I don't know how to implement them yet :P
Keep trying.

Offline TheNlightenedOne

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 427
  • Rating: +16/-1
    • View Profile
Re: Re: TI-Nspire Task Manager
« Reply #7 on: March 17, 2013, 02:44:28 pm »
I really like this! Quite interesting. +1 for you, compu!
"Eris" (Ndless 3.1)
"Keto" (Ndless 3.1)
"Luna" (AMS 3.10, HW4)
"Aurora" (2.55MP)

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: TI-Nspire Task Manager
« Reply #8 on: March 17, 2013, 02:45:50 pm »
Interesting ;)
I've spread out the word to TI-Planet: https://tiplanet.org/forum/viewtopic.php?f=17&t=11414
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: TI-Nspire Task Manager
« Reply #9 on: March 17, 2013, 03:04:11 pm »
Thanks guys :)

I have added the possibility to display and delete memory pools, so you can, for example, view your free RAM.
Deleting is relatively useless because it'll give you a low memory screen :P

Offline excale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 103
  • Rating: +19/-1
    • View Profile
Re: TI-Nspire Task Manager
« Reply #10 on: March 17, 2013, 03:48:51 pm »
Added support for CAS as I wanted to test it...
Code: [Select]
#ifndef SYSCALLS_H
#define SYSCALLS_H

/* Task */

static const unsigned int tcf_established_tasks_addrs[] = { 0x102F0C1C, 0x102F1348, 0x0, 0x10 };
#define TCF_Established_Tasks SYSCALL_CUSTOM(tcf_established_tasks_addrs, unsigned, void)

static const unsigned int tcc_current_task_pointer_addrs[] = { 0x102EFBF4, 0x102F0320, 0x0, 0x0 };
#define TCC_Current_Task_Pointer SYSCALL_CUSTOM(tcc_current_task_pointer_addrs, void*, void)

static const unsigned int tcf_task_information_addrs[] = { 0x102F0D10, 0x102F143C, 0x0, 0x0 };
#define TCF_Task_Information SYSCALL_CUSTOM(tcf_task_information_addrs, int, void*, char*, unsigned char*, unsigned*, unsigned char*, unsigned char*, unsigned*, void**, unsigned*, unsigned*)

static const unsigned int tcf_task_pointers_addrs[] = { 0x102F0E80, 0x102F15AC, 0x0, 0x0 };
#define TCF_Task_Pointers SYSCALL_CUSTOM(tcf_task_pointers_addrs, unsigned, void**, unsigned)

static const unsigned int tcc_terminate_task_addrs[] = { 0x102F06C0, 0x102F0DEC, 0x0, 0x0 };
#define TCC_Terminate_Task SYSCALL_CUSTOM(tcc_terminate_task_addrs, unsigned, void*)

/* Dynamic memory */

static const unsigned int dmf_established_memory_pools_addrs[] = { 0x10273948, 0x10274074, 0x0, 0x0 };
#define DMF_Established_Memory_Pools SYSCALL_CUSTOM(dmf_established_memory_pools_addrs, unsigned, void)

static const unsigned int dmf_memory_pool_information_addrs[] = { 0x10273960, 0x1027408C, 0x0, 0x0 };
#define DMF_Memory_Pool_Information SYSCALL_CUSTOM(dmf_memory_pool_information_addrs, unsigned, void*, char*, void**, unsigned*, unsigned*, unsigned*, unsigned char*, unsigned*, void*)

static const unsigned int dmf_memory_pool_pointers_addrs[] = { 0x10273A6C, 0x10274198, 0x0, 0x0 };
#define DMF_Memory_Pool_Pointers SYSCALL_CUSTOM(dmf_memory_pool_pointers_addrs, unsigned, void**, unsigned)

static const unsigned int dmc_delete_memory_pool_addrs[] = { 0x10277C28, 0x10278354, 0x0, 0x0 };
#define DMC_Delete_Memory_Pool SYSCALL_CUSTOM(dmc_delete_memory_pool_addrs, unsigned, void*)

#endif

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: TI-Nspire Task Manager
« Reply #11 on: March 17, 2013, 04:10:13 pm »
Thanks! :)
I guess you did that via idcmigrate, right?
How can I export the function names into an .idc file?

Offline excale

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 103
  • Rating: +19/-1
    • View Profile
Re: TI-Nspire Task Manager
« Reply #12 on: March 17, 2013, 04:13:07 pm »
Idcmigrate is quite buggy, so I did it by hand (it was really easy since all I had to do was to match the lines in the xrefs of TCT_Check_Stack).

Also: File->Produce File->Dump database into IDC file :). (Warning: some personal informations are dumped in this file, like licence information, paths (if you have your real name as username)... )
« Last Edit: March 17, 2013, 04:19:30 pm by excale »

Offline SpiroH

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +153/-23
    • View Profile
Re: TI-Nspire Task Manager
« Reply #13 on: March 19, 2013, 10:08:45 am »
Maybe wirte a feature that allows you to explore, to a greater extent, the purpose of a task and/or what and/or how it does what it is doing? Monitor the CPU for different things like I/O and the memory section with a viewer for the selected task? A scheduler and a performance monitor, as well as a memory viewer, is always a nice feature :) I give ideas! I don't know how to implement them yet :P
Nice ideas indeed! But that implies quite a bit of digging up. ;) Why not give it a try and come up with some substance? You can do it!

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: TI-Nspire Task Manager
« Reply #14 on: March 19, 2013, 10:32:45 am »
And another update that allows you to view event groups and queues (non-CAS only, tasks and memory pools work on CAS/non-CAS, thanks excale) :)
I have fixed the grayscale bug (the background is white now as it should be) and added double buffering to Nspire I/O (no flickering anymore).
In the new settings menu you can enable interrupts. When interrupts are on, you can see the event queue filling up when pressing refresh ;)