119 karma · joined Oct 22, 2020 (6y ago) · 54 submissions
andy@threos.io
comment 1y ago · link · parent
2010–2024: Wireless voting system for a bank’s annual shareholder meetings.
ARM-based handheld terminals with 2.4GHz RF and LDPC error correction
Custom embedded OS, base stations, and 3D-printed enclosures
Deployed and used continuously for 14 years
2006–2014: Distributed IoT platform (prototype)
Embedded VM and bytecode execution on custom hardware
Desktop CAD-style app for dataflow programming
Fully working prototype demonstrated at trade shows
2014–2017: Hardware/software unit for tax inspection system
Project delivered; final deployment halted due to partner backing out
2015–Present: Threos OS (https://threos.io)
Object-oriented, modular real-time operating system
Single virtual address space with memory protection, multitasking
POSIX subset, package manager, dynamic linking and relocation
Dynamically linked libraries
Ported applications: GCC, Python, nano, etc.
Functional on x86_64 hardware
2017–2021+: Remote network monitoring system for a telecom company
1U embedded Linux device with modular IO, deployed and in daily use
Web-based configuration UI
Modules: LTE, environmental sensors, backup battery
2020–2025: Wireless IoT system for utility monitoring
Proprietary RF protocol over 433MHz LoRa
Battery-backed modules for impulse counting, DSMR, environmental monitoring
Gateway with LTE, Wi-Fi, and LoRa, managed via web UI
Fully functional prototype statecomment 1y ago · link · parent
Location: EU / Hungary
Remote: Yes
Willing to relocate: Mostly no, but open if absolutely necessary
Technologies: Embedded systems, OS development, C/C++, Assembly, Python, Java, Lua, JavaScript, TypeScript, React
Résumé/CV: Available on request
Email: andy@threos.io
Hi HN,We’re a small team of experienced developers based in the EU, looking for new contract opportunities. We're at a transition point and open to engaging with new projects, especially those that value deep technical expertise and long-term reliability.
We’ve worked across various hardware/software domains, including embedded systems, custom operating systems, and networked IoT platforms. Some highlights of our work:
next comment
Core Team: Me – Product manager, embedded senior dev, hardware design reviewer, Threos OS architect, C/C++/asm/Python/JS and others, some Django, 3D design
Teammate 1 – Software developer/designer (C/C++ and others)
Teammate 2 – Software developer/designer (C/C++, JavaScript, TypeScript and others)
We also work with a wider circle of trusted collaborators: industrial designers, hardware engineers, generalist devs, and subcontractors as needed.We love working on challenging technical projects—especially those involving embedded systems, custom hardware, or low-level software. We're not afraid to roll our own solutions when needed, whether that's a communication protocol, a lightweight virtual machine, or a custom scheduler. If you think we might be a good fit for your team or project, feel free to reach out at andy@threos.io. We'd love to hear from you.
comment 2y ago · link · parent
The implementation should store a state machine for the game, a struct for each pieces, and also the board with index to the pieces (occupation).
There is only 16 pieces for each player, the two players move one another.
The Naive would be that you index the pieces (4 bits) and store the movement after that,
Pawns 2 bits for movement (2 forward, 2 diagonal)
King 4 bits for movement (normal move 1 + 3 bits, castle 1 + 1 bits)
Knight 3 bits for movement (8 possible move)
Rook 4 bits for movement ( 1 bit orientation horizontal/vertical 3 bit new position )
Bishop 4 bits for movement ( 1 bit orientation left/right diagonal 3 bit new position)
Queen 5 bits for movement ( 2 bit orientation horizontal/vertical/ left/right diagonal 3 bits for new position)
This way you need
Pawn 4 (index) + 2 (movement) = 6 bits
King 4 (index) + 4 (movement) = 8 bits
Knight 4 (index) + 3 (movement) = 7 bits
Rook, Bishop 4 (index) + 4 (movement) = 8 bits
Queen 4 (index) + 5 (movement) = 9 bits
But you can encode the pieces index in another way, that the Queen got 3 bit index and other pieces got longer index (Pawn 5 bits)
index bits + movement 000 + 5 movement Queen -> 8 bits
00100 + 3 movement King Normal -> 8 bits
00101 + 1 movement King castle -> 6 bits
0011x + 3 movement Knight (2) -> 8 bits
01xxx + 2 movement Pawn (8) -> 7 bits
10x + 4 movement Bishop (2) -> 7 bits
11x + 4 movement Rook (2) -> 7 bits
Also other bit allocations are possible, I don't know if it's worth it to make the Pawns index 1 bit longer, but in this way the max 8 bits required for a movement. (You need the state machine for the "decompression", also have to track that the black and white Pawns are moving in the opposite direction. )
There can be further compression, if you check the possible move for the piece. ex. the first possible Knight movement is only 1 place, so no need to store the movement. But this need more calculation.
4.
Colonizing Mars isn't a rocket problem(centuryofbio.com ↗)
4 points · by andy_threos_io · 2y ago · 3 comments
comment 2y ago · link · parent
Example.
In file threadx-master/ports/cortex_a7/gnu/src/tx_thread_schedule.S
in this code
/* Increment the run count for this thread. */
LDR r2, [r0, #4] // Pickup run counter
LDR r3, [r0, #24] // Pickup time-slice for this thread
ADD r2, r2, #1 // Increment thread run-counter
STR r2, [r0, #4] // Store the new run counter
the indexes to the data structures are really hard to modify, so you can't make modifications to the structures easy, the C structures and the assembly code indexes must be in sync, or the system will crash. And there are literally 100s of files with assembly indexes in the code.But it can be made it easier, with another layer and macro preprocessing. So make a header one for the assembly and one for the C code, and define the struct with the macro. The assembly code can be compiled with C preprocessor, so the macros will work.
This way the C and the ASM stay sync. Only drawback, that the struct must be defined with this macros. But this is only for the structures that are used both in assembly and C or higher level.
Anyway if the indexes in the assembly code would be macros, that would be also much easier to modify.
comment 3y ago · link · parent
G codes in fact have command for arcs.
G02 establishes a mode for clockwise circular arcs. G03 establishes a mode for counter-clockwise circular arcs.
7.
New technology could blow away GPT-4 and everything like it(zdnet.com ↗)
102 points · by andy_threos_io · 3y ago · 17 comments
comment 5y ago · link · parent
https://blog.rust-lang.org/2021/05/10/Rust-1.52.1.html
"The Rust team has prepared a new release, 1.52.1, working around a bug in incremental compilation which was made into a compiler error in 1.52.0. We recommend all Rust users, including those currently using stable versions prior to 1.52.0, upgrade to 1.52.1 or disable incremental compilation. Guidance on how to do so is available below."
Is this mature enough to be bring in the kernel ????
comment 5y ago · link · parent
-no segmentation, flat address space
-better interrupt handling
-better system call
-more registers
etc.
Also we found that Qemu or other Virtualization technology may cover up some of the hardware issues. Eg. Beside, that every hardware device (keyboard, usb, display, disk etc.) will have some simplified behavior, if you emulate an ARM cpu on x86_64 host, than the cache coherency will totally messed up on real hardware.comment 5y ago · link · parent
All sort of magic happens in BIOS, but after transition to 64bit, it should be fine.
The only problem is when BIOS programs some kind of hardware (usb), to write things into the memory like descriptors etc. and the hardware will overwrite portion of the memory.
This happens on some board with some versions of u-boot for ARM. There you should disable all the hardware devices before running your kernel, u-boot may be left the device enabled.
comment 5y ago · link · parent
Also if you have permission, you can call CreateThread [2] system call and start a thread in other task. (Normally you don't have permission.)
[1]: https://threos.io/
[2]: https://threos.io/docs/threos/html/syscall.html#syscall_Crea...
Handle CreateThread(Handle task, PFN_THREADENTRY start, void* data, uintptr_t type, void* sp);
comment 5y ago · link · parent
Just write the wrapper as a C extension module, and in the module make the system call with proper library call.
like in the following code:
https://github.com/torvalds/linux/blob/master/samples/vfs/te...
This way it will be portable!
A couple of weeks ago, I just made for our OS's system calls. It's only a first draft, but works fine.
You could also parse the C header for constant values.
(Actually, I wrote a python script to generate the C extension for the system calls also, not just for the constants)
comment 5y ago · link · parent
on newer x86_64 the accounting code is around 100-200 cycles, so not a big deal, interrupt return and exit code is more than that (save context, load new context etc.).
The RDTSC and fence timings (Latency, Reciprocal throughput) [0]:
AMD Zen 1
SFENCE 4 ~20
LFENCE 1 0.25
MFENCE 7 ~70
RDTSC 37 36
AMD Zen 2
SFENCE 1 1
LFENCE 1 11
MFENCE 7 ~78
RDTSC 37 37
AMD Zen 3
SFENCE 1 1
LFENCE 1 10
MFENCE 6 ~60
RDTSC 44 36
Intel Haswell
LFENCE 2 4
MFENCE 3 33
SFENCE 2 5
RDTSC 15 24
Intel Broadwell
LFENCE 2 4
MFENCE 3 33
SFENCE 2 6
RDTSC 15 24
Intel Skylake
LFENCE 2 4
MFENCE 4 33
SFENCE 2 6
RDTSC 20 25
Intel Skylake-X
LFENCE 2 4
MFENCE 4 33
SFENCE 2 6
RDTSC 20 25
Intel Coffee Lake
LFENCE 2 4
MFENCE 4 33
SFENCE 2 6
RDTSC 20 25
[0] https://www.agner.org/optimize/instruction_tables.pdfcomment 5y ago · link · parent
comment 5y ago · link · parent
(you need surface to get it)
All we have to do is to harness the sun energy in the most efficiency and harmless way.
Almost all the energy used on earth comes from the sun. The nuclear*, geothermal and tidal power are more or less exceptions.
* (I'm not against nuclear power and research, as we need that technology to be able to travel in space in smaller spaceships rather than this large one (some may call it earth) we use now. Right now we travel where our sun goes, not where we like to explore.)
In every energy usage the key is the efficiency of the conversion.
Fossil fuel's efficiency is less then 1-2% from the sun due to the efficiency of the photosynthesis [2]. All of the fossil fuels are nothing but stored solar energy with less then 1-2% efficiency. And we don't calculate with waste from the mining refining transportation etc. energy cost. And for useful energy (work) you have to burn it in a power plant or a car or whatever with maximum 10-50% efficiency [3]. So the overall efficiency is less than 1%.
On the other hand solar cells with 20%+ efficiency are commercial available, wind farms are better and hydro power can be even better. (wind and hydro power are also comes indirect from the sun)
(BTW the low efficiency of the photosynthesis is why the corn based fuels are waste of the solar energy, and land. You could generate the same amount of energy with solar power on less than 1/20th of the land with corn. If you need fossil fuel, algae is a much better alternative, as it's photosynthesis efficiency is higher than corn [4], also does not require valuable land, which can be used for other agriculture purpose (food) )
But, far the largest pro for the solar energy is that it will not run out in the near future (at least 5 billion years, even earth will be destroyed way before the sun run out of fuel), fossil fuels will run out, it does not matter if it's 50, 100 or 1000 years from now, but it will run out. Period. (that's the same problem with current nuclear power technology beside other factors)
So you have an energy that practically will not run out, have better total efficiency about 20-100+ times than fossil fuel (and side effect it's cleaner), *
and someone still surprised that this is the future...** yes, we need to work on energy storage
[1] https://en.wikipedia.org/wiki/Nuclear_fusion
[2] https://en.wikipedia.org/wiki/Photosynthetic_efficiency
[3] https://en.wikipedia.org/wiki/Energy_conversion_efficiency
[4] https://en.wikipedia.org/wiki/Algae_fuel22.
Ajit Pai declares 3Mbps uploads are still good enough for you(theverge.com ↗)
2 points · by andy_threos_io · 5y ago · discuss
comment 5y ago · link · parent
/usr/lib/system/libsystem_kernel.dylib
ex. https://stackoverflow.com/questions/37656016/osx-setgid-syst...
comment 5y ago · link · parent
bl _Open ; whatever syscall name you have
and the linker or the OS dynamic linker will get you the proper system call code, with the numbers.BTW even in our small threos.io os we use dynamic linked system calls.
comment 5y ago · link · parent
First thing first, macro assemblers have been around for at least 40+ years. So don't use numbers in your code. use macros or defines.
Ex. you can compile with gcc flags -x assembler-with-cpp
and you can have nice defines in your code.
Second on a decent OS even in assembly link against operating system call library, no matter what. The system call numbers can change. so use symbols.
Also don't write the string length in the code, it's total lame.
and use .asciz not .ascii
and define your function symbols to function gcc:
.global my_func_name
.type my_func_name, function
my_func_name:
if you use C preprocessor for assembly compile just make an include like this: #define _FUNCTION(A) .global A ;\
.type A, function
EDIT:
For the not well informed HN readers:https://developer.apple.com/library/archive/qa/qa1118/_index...
"Apple does not support statically linked binaries on Mac OS X. A statically linked binary assumes binary compatibility at the kernel system call interface, and we do not make any guarantees on that front. Rather, we strive to ensure binary compatibility in each dynamically linked system library and framework."
So DON'T write direct system call numbers in your code!
comment 5y ago · link · parent