Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: compu 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
-
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 :).
-
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...
-
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 :)
-
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 ;) )
-
Excellent!
(http://img23.imageshack.us/img23/4663/taskmanagernoncas310392.gif)
-
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
-
I really like this! Quite interesting. +1 for you, compu!
-
Interesting ;)
I've spread out the word to TI-Planet: https://tiplanet.org/forum/viewtopic.php?f=17&t=11414
-
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
-
Added support for CAS as I wanted to test it...
#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
-
Thanks! :)
I guess you did that via idcmigrate, right?
How can I export the function names into an .idc file?
-
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)... )
-
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!
-
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 ;)
-
Keep on flexing your muscles. So far so good. ;)
-
Nice stuff. That reminds me, is it possible on the Nspire to have multiple BASIC or Lua documents open simultaneously? Also are there often background tasks starting randomly like on a computer like Windows update?
-
Nice stuff. That reminds me, is it possible on the Nspire to have multiple BASIC or Lua documents open simultaneously? Also are there often background tasks starting randomly like on a computer like Windows update?
You can have multiple Lua apps open by putting one on each page if that's what you mean. And I'm curious about random tasks as well :) (I'll go on a killing spree this afternoon to see what each process does when killed :P)
-
Updated for CAS again :) :
#ifndef SYSCALLS_H
#define SYSCALLS_H
/* Tasks */
static const unsigned int tcf_established_tasks_addrs[] = { 0x102F0C1C, 0x102F1348, 0x0, 0x0 };
#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*)
/* Event groups */
static const unsigned int evf_established_event_groups_addrs[] = { 0x103D0284, 0x103D09B4, 0x0, 0x0 };
#define EVF_Established_Event_Groups SYSCALL_CUSTOM(evf_established_event_groups_addrs, unsigned, void)
static const unsigned int evf_event_group_information_addrs[] = { 0x103D029C, 0x103D09CC, 0x0, 0x0 };
#define EVF_Event_Group_Information SYSCALL_CUSTOM(evf_event_group_information_addrs, unsigned, void*, char*, unsigned*, unsigned*, void**)
static const unsigned int evf_event_group_pointers_addrs[] = { 0x103D036C, 0x103D0A9C, 0x0, 0x0 };
#define EVF_Event_Group_Pointers SYSCALL_CUSTOM(evf_event_group_pointers_addrs, unsigned, void**, unsigned)
static const unsigned int evc_delete_event_group_addrs[] = { 0x10273E84, 0x102745B0, 0x0, 0x0 };
#define EVC_Delete_Event_Group SYSCALL_CUSTOM(evc_delete_event_group_addrs, unsigned, void*)
/* Queues */
static const unsigned int quf_established_queues_addrs[] = { 0x1027685C, 0x10276F88, 0x0, 0x0 };
#define QUF_Established_Queues SYSCALL_CUSTOM(quf_established_queues_addrs, unsigned, void)
static const unsigned int quf_queue_information_addrs[] = { 0x10276874, 0x10276FA0, 0x0, 0x0 };
#define QUF_Queue_Information SYSCALL_CUSTOM(quf_queue_information_addrs, unsigned, void*, char*, void**, unsigned*, unsigned*, unsigned*, unsigned char*, unsigned*, unsigned char*, unsigned*, void**)
static const unsigned int quf_queue_pointers_addrs[] = { 0x102769AC, 0x102770D8, 0x0, 0x0 };
#define QUF_Queue_Pointers SYSCALL_CUSTOM(quf_queue_pointers_addrs, unsigned, void**, unsigned)
static const unsigned int quc_delete_queue_addrs[] = { 0x1027671C, 0x10276E48, 0x0, 0x0 };
#define QUC_Delete_Queue SYSCALL_CUSTOM(quc_delete_queue_addrs, unsigned, void*)
static const unsigned int quc_receive_from_queue_addrs[] = { 0x10275AC0, 0x102761EC, 0x0, 0x0 };
#define QUC_Receive_From_Queue SYSCALL_CUSTOM(quc_receive_from_queue_addrs, unsigned, void*, void*, unsigned, unsigned*, unsigned)
#endif
-
Thanks again :)
-
Nspire CX CAS:
#ifndef SYSCALLS_H
#define SYSCALLS_H
/* Tasks */
static const unsigned int tcf_established_tasks_addrs[] = { 0x102F0C1C, 0x102F1348, 0x0, 0x102F0E18 };
#define TCF_Established_Tasks SYSCALL_CUSTOM(tcf_established_tasks_addrs, unsigned, void)
static const unsigned int tcc_current_task_pointer_addrs[] = { 0x102EFBF4, 0x102F0320, 0x0, 0x102EFDF0 };
#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, 0x102F0F0C };
#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, 0x102F107C };
#define TCF_Task_Pointers SYSCALL_CUSTOM(tcf_task_pointers_addrs, unsigned, void**, unsigned)
static const unsigned int tcc_terminate_task_addrs[] = { 0x102F06C0, 0x102F0DEC, 0x0, 0x102F08BC };
#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, 0x10273B48 };
#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, 0x10273B60 };
#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, 0x10273C6C };
#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, 0x10277E28 };
#define DMC_Delete_Memory_Pool SYSCALL_CUSTOM(dmc_delete_memory_pool_addrs, unsigned, void*)
/* Event groups */
static const unsigned int evf_established_event_groups_addrs[] = { 0x103D0284, 0x103D09B4, 0x0, 0x103CE2D4 };
#define EVF_Established_Event_Groups SYSCALL_CUSTOM(evf_established_event_groups_addrs, unsigned, void)
static const unsigned int evf_event_group_information_addrs[] = { 0x103D029C, 0x103D09CC, 0x0, 0x103CE2EC };
#define EVF_Event_Group_Information SYSCALL_CUSTOM(evf_event_group_information_addrs, unsigned, void*, char*, unsigned*, unsigned*, void**)
static const unsigned int evf_event_group_pointers_addrs[] = { 0x103D036C, 0x103D0A9C, 0x0, 0x103CE3BC };
#define EVF_Event_Group_Pointers SYSCALL_CUSTOM(evf_event_group_pointers_addrs, unsigned, void**, unsigned)
static const unsigned int evc_delete_event_group_addrs[] = { 0x10273E84, 0x102745B0, 0x0, 0x10274084 };
#define EVC_Delete_Event_Group SYSCALL_CUSTOM(evc_delete_event_group_addrs, unsigned, void*)
/* Queues */
static const unsigned int quf_established_queues_addrs[] = { 0x1027685C, 0x10276F88, 0x0, 0x10276A5C };
#define QUF_Established_Queues SYSCALL_CUSTOM(quf_established_queues_addrs, unsigned, void)
static const unsigned int quf_queue_information_addrs[] = { 0x10276874, 0x10276FA0, 0x0, 0x10276A74 };
#define QUF_Queue_Information SYSCALL_CUSTOM(quf_queue_information_addrs, unsigned, void*, char*, void**, unsigned*, unsigned*, unsigned*, unsigned char*, unsigned*, unsigned char*, unsigned*, void**)
static const unsigned int quf_queue_pointers_addrs[] = { 0x102769AC, 0x102770D8, 0x0, 0x10276BAC };
#define QUF_Queue_Pointers SYSCALL_CUSTOM(quf_queue_pointers_addrs, unsigned, void**, unsigned)
static const unsigned int quc_delete_queue_addrs[] = { 0x1027671C, 0x10276E48, 0x0, 0x1027691C };
#define QUC_Delete_Queue SYSCALL_CUSTOM(quc_delete_queue_addrs, unsigned, void*)
static const unsigned int quc_receive_from_queue_addrs[] = { 0x10275AC0, 0x102761EC, 0x0, 0x10275CC0 };
#define QUC_Receive_From_Queue SYSCALL_CUSTOM(quc_receive_from_queue_addrs, unsigned, void*, void*, unsigned, unsigned*, unsigned)
#endif
(In fact, I spent more time trying to compile the new nspireIO to test than to port the syscalls :P. The compiler looks for the .a in /sdk/ndless/lib/ and for the .h in %home%/.ndless/include )
EDIT: += CX non-CAS
#ifndef SYSCALLS_H
#define SYSCALLS_H
/* Tasks */
static const unsigned int tcf_established_tasks_addrs[] = { 0x102F0C1C, 0x102F1348, 0x102F0688, 0x102F0E18 };
#define TCF_Established_Tasks SYSCALL_CUSTOM(tcf_established_tasks_addrs, unsigned, void)
static const unsigned int tcc_current_task_pointer_addrs[] = { 0x102EFBF4, 0x102F0320, 0x102EF660, 0x102EFDF0 };
#define TCC_Current_Task_Pointer SYSCALL_CUSTOM(tcc_current_task_pointer_addrs, void*, void)
static const unsigned int tcf_task_information_addrs[] = { 0x102F0D10, 0x102F143C, 0x102F077C, 0x102F0F0C };
#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, 0x102F08EC, 0x102F107C };
#define TCF_Task_Pointers SYSCALL_CUSTOM(tcf_task_pointers_addrs, unsigned, void**, unsigned)
static const unsigned int tcc_terminate_task_addrs[] = { 0x102F06C0, 0x102F0DEC, 0x102F012C, 0x102F08BC };
#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, 0x102733B8, 0x10273B48 };
#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, 0x102733D0, 0x10273B60 };
#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, 0x102734DC, 0x10273C6C };
#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, 0x10277698, 0x10277E28 };
#define DMC_Delete_Memory_Pool SYSCALL_CUSTOM(dmc_delete_memory_pool_addrs, unsigned, void*)
/* Event groups */
static const unsigned int evf_established_event_groups_addrs[] = { 0x103D0284, 0x103D09B4, 0x103CDB44, 0x103CE2D4 };
#define EVF_Established_Event_Groups SYSCALL_CUSTOM(evf_established_event_groups_addrs, unsigned, void)
static const unsigned int evf_event_group_information_addrs[] = { 0x103D029C, 0x103D09CC, 0x103CDB5C, 0x103CE2EC };
#define EVF_Event_Group_Information SYSCALL_CUSTOM(evf_event_group_information_addrs, unsigned, void*, char*, unsigned*, unsigned*, void**)
static const unsigned int evf_event_group_pointers_addrs[] = { 0x103D036C, 0x103D0A9C, 0x103CDC2C, 0x103CE3BC };
#define EVF_Event_Group_Pointers SYSCALL_CUSTOM(evf_event_group_pointers_addrs, unsigned, void**, unsigned)
static const unsigned int evc_delete_event_group_addrs[] = { 0x10273E84, 0x102745B0, 0x102738F4, 0x10274084 };
#define EVC_Delete_Event_Group SYSCALL_CUSTOM(evc_delete_event_group_addrs, unsigned, void*)
/* Queues */
static const unsigned int quf_established_queues_addrs[] = { 0x1027685C, 0x10276F88, 0x102762CC, 0x10276A5C };
#define QUF_Established_Queues SYSCALL_CUSTOM(quf_established_queues_addrs, unsigned, void)
static const unsigned int quf_queue_information_addrs[] = { 0x10276874, 0x10276FA0, 0x102762E4, 0x10276A74 };
#define QUF_Queue_Information SYSCALL_CUSTOM(quf_queue_information_addrs, unsigned, void*, char*, void**, unsigned*, unsigned*, unsigned*, unsigned char*, unsigned*, unsigned char*, unsigned*, void**)
static const unsigned int quf_queue_pointers_addrs[] = { 0x102769AC, 0x102770D8, 0x1027641C, 0x10276BAC };
#define QUF_Queue_Pointers SYSCALL_CUSTOM(quf_queue_pointers_addrs, unsigned, void**, unsigned)
static const unsigned int quc_delete_queue_addrs[] = { 0x1027671C, 0x10276E48, 0x1027618C, 0x1027691C };
#define QUC_Delete_Queue SYSCALL_CUSTOM(quc_delete_queue_addrs, unsigned, void*)
static const unsigned int quc_receive_from_queue_addrs[] = { 0x10275AC0, 0x102761EC, 0x10275530, 0x10275CC0 };
#define QUC_Receive_From_Queue SYSCALL_CUSTOM(quc_receive_from_queue_addrs, unsigned, void*, void*, unsigned, unsigned*, unsigned)
#endif
-
Nice!
Here is the tns file with full classic/CX support for the people who can't compile it themselves.
-
Does this mean that we can set priorities higher to make it run faster?
-
Does this mean that we can set priorities higher to make it run faster?
I don't think higher priorities will make your calc run faster.
Also, it won't let me exit sometimes D:. When leaving sometimes the selection goes up and down in the menu screen and then taskmanager restarts. Other times it just restarts as soon as you exit :P I'm using a CX.
-
Sorry for the double post but I felt like it didn't really fit in as an edit. I've made a list of what happens when a process is killed. It's far from complete as most processes don't seem to have a direct impact on calculator performance and others are quite funny like disabling the off button :)
Just the plain list:
https://docs.google.com/spreadsheet/pub?key=0Al5dJ7BUU6MkdDNfOHdSYVRROXlUS0prTWdjWHN1YlE&output=html
If you've found something add it here:
https://docs.google.com/spreadsheet/ccc?key=0Al5dJ7BUU6MkdDNfOHdSYVRROXlUS0prTWdjWHN1YlE&usp=sharing
-
Does this mean that we can set priorities higher to make it run faster?
I don't think higher priorities will make your calc run faster.
No, I mean like when you set the priority higher on windows. It makes the program run faster. So could we do the same with Programs?
-
No, I mean like when you set the priority higher on windows. It makes the program run faster. So could we do the same with Programs?
Interrupts' priorities are something very different from the "priority" of programs you're talking about.
To keep it simple, you can't make your program faster that way :).