Join us on Discord!
You can help CodeWalrus stay online by donating here.
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - nspiredev500

#1
While programming for my Nspire CX CAS CR4 I thought that either my calculator is weird, or the documented timer frequency for the watchdog timer isn't right.
I also found out you can set the frequency of the other timers.
But right now, this is only tested in my calculator.
To help, you only need a Nspire CX and a stopwatch.
I compiled a version of my project to test the timers and print out the result.
You just have to follow the instructions on the screen and post the values.

Instructions:
Make sure you don't need the contents of the scratchpad and saved the opened document, as you can only exit the test by using the reset button at the back.
Copy the charset.tns and the timertest file for your hardware revision to your documents folder.
The hardware revision is the letters on the top-right of the back of your calculator.
First is a series of 10 flashes of red, green and blue with (what should be) one second of delay between them.
You have to record the time between the flashes and post them (or just take the average time like I did).
Then you just have to write down an post the values it shows on the screen.

Thanks in advance

My results are:
msleep: 1.002 seconds between the flashes on average
initial clockselect: 0
timer: 33031944
timer+clockselect=0xa: 31958
timer+clockselect=0x9: 11704931
#2
I wasn't satisfied with the 25% accuracy of the battery reading of my TI nspire CX CAS, so I want to make a program that shows you a more accurate percentage.
But to do this, I need much data from differed reported battery voltages with the corresponding reported percentage from the os.
I made a program that displays a dialog with 3 voltages when run.

I would like to have as many people as possible report back their calculator model (classic or CX), the voltage levels from the program and the reported battery percentage by the os (hover over the battery icon whith the cursor).
It would be very time-consuming to gather all that data myself, and I only have a CX calculator.

I can't seem to get attachments working so here is the download from github.

The full repository is here.

My first readings are:
0.0V
3.909677V
0.206452V
#3
TLDR: I am currently trying to create an operating system for the ti nspire and just hit a (small) milestone, searching for testers in the future

In my current project, called simply OSExt for now (because it should extend the normal ti OS sometime in the future), I deviated from simply writing a program that I wanted to integrate with the OS to wanting to write a whole paralell OS kernel.
The whole kernel-idea started because I hated it when I tried to test a program and the calculator crashed, leaving me waiting for it to reboot, and with no clue why it even crashed in the first place.


This is a massive undertaking, and I may never finish it, but I now have a small testing-version finished, which can run a programm in userspace in its own virtual address space, where it can't do harm to the rest of the system if it goes wrong.
Now I need to implement a proper program loader, a way for the program to use files, allocate new memory, create new processes and communicate with them.
I want to use the newlib library, which is actually already used by ndless, so it shouldn't be that hard to port.
My goal is to make a complete POSIX system, so I can eventually port some open-source software to my os.

If someone wants to help me, or maybe volunteer to test it if it's more mature, I'd be happy. Because I only have an ti nspire CX CAS HW-AA, I can only test the rest in the emulator myself.
If you want to test it in firebird yourself: the github page or the .tns file


The current Roadmap:
  • implementing a way for programs to allocate memory
  • implementing a way for programs to access files, if they have the permission
  • implementing POSIX fork and exec to create new processes
  • implementing a message system and a pipe system for the programs to communicate
  • porting newlib
  • implementing a dynamic linker for shared libraries
  • making a lcd driver
  • making a keypad driver
  • making a touchpad driver
  • making a desktop environment with a file browser and the ability to execute programs and let them display to the screen
  • optimizing memory usage
long-term:
  • if I'm not dead already, implementing a usb storage driver (will certainly take much time for this one)
  • porting gcc and binutils, so I can develop the kernel on my calculator
  • if I'm somehow still alive, integrating it into nLoader to boot from it

I have this shell for debug output:


And here is my proof of going into userspace:


Here is the address space. All but the first and second entries are my kernel:

#4
I want to show the battery charge to the user while my program is running, so I have to read it myself.
To test it I made a small program that reads the voltages and shows them, but it only works in firebird, not on my CX CAS HW-AA.
In firebird it shows:
VBATT: 6.0
VSYS: 6.0
B12: 3.0

on my calculator:
VBATT: 0.0
VSYS: 4.0
B12: 0.0

Is my program or my calculator broken?
Or is only VSYS used in real calculators?

At 50% my calculator now shows 3V for VSYS, so it really seems only VSYS is used.

Thanks in advance if anyone knows more, I haven't found anything about this.

Here is the hackspire entry for the ADC:
https://hackspire.org/index.php?title=Memory-mapped_I/O_ports_on_CX#C4000000_-_Analog-to-Digital_Converter_.28ADC.29

my program (download link from my omnimaga post, codewalrus doesn't seem to like zip files)
#5
I managed to get a system working (in firebird, not yet tested on hardware) that lets programms request function tables from libraries (sort-of dynamic linking from what I understand, maybe I'll do a proper dynamic linker with resolving missing symbols in the files, but I currently don't know enough about that).
When handled by header files to define function pointers with the right names and parameters, a programm doesn't have to include the functions, thus reducing the size of the binary and the size occupied in RAM if multiple programms use the same library.
It would also make it easier to update a library inside a program, you would just update your library.
I have a PoC on a github repo along with a short screen recoding showing that it works.

If you're interested, it works by replacing itself as the system call handler and then catches system calls that have a certain signature and runs them.
There are 2 system calls: registering a function table as a library with a specific name, and requesting a function table with a name.
It searches in a path (in this case /documents/ndless/) for a library with that name and runs it. The library should register itself with its name and the functions it wants to export.
Because the swi handler address isn't os-specific, this PoC should work on every hardware and software version. I testet it in firebid with 4.5 CX CAS HW W, 4.5 CX HW W and 4.5 HW J.


For anyone wondering why I even did this, I plan to make a programm that is divided up into modules, and these modules should be easily replacable by a user without recompilation (no one would do that and it is some work to get the ndless-sdk running).
In this case it would be as easy as swapping out one file.
#6
This is a small project I started mainly for myself, but I thought other people could use, too.
At this stage it's just a miniclock (NClock's miniclock doesn't seem to work on OS 4.5) on the top right corner and a way to disable usb transfers (so other people can't mess with your files).
Planned are a desktop, a shell, and a login manager (so people can't just edit the files directly on calc).
You can leave Suggestions as a github issue (or here) if you want.
Currently only for OS 4.5 CAS and non-CAS, CAS tested on real hardware.
Leave an issue at github (or here) if you want a version for another OS version.
https://github.com/nspiredev500/OSExt

I hope it's usefull for someone



Powered by EzPortal