HNHacker News
TopNewBestAskShowJobs

jhallenworld

4,964 karma · joined October 31, 2013

submissionscomments
jhallenworld··on RTEMS Real Time Operating System
I used RTEMS on Movidius Myriad vision CPU (running on LEON- a SPARC clone).

I remember the RTEMS event concept was not very good- the events are globally shared. You are better off using semaphores.

>I have realized that for a majority of the embedded software using an RTOS is an overkill

I agree with this. Instead of an OS, we like to use a small framework that provides a CLI, database and UART communications (YMODEM protocol). It's a single stack system that provides a simple work-queue for scheduling callbacks, and for interrupt code to schedule non-interrupt code. It works for almost everything as long as you are comfortable programming in an event-driven style.

https://github.com/nklabs/libnklabs

(recently added support for AVR 8-bit processors).

jhallenworld··on Micron's 232-layer NAND enables 2TB flash chips that deliver data 50% faster
Well under normal conditions (no degenerate matter)- the material with the lowest molar volume should give a good idea. At least on earth, this happens to be diamond: so ~1.7 * 10^20 atoms / mm^3.

With one bit per atom: 20 million TB.

jhallenworld··on An STM32 emulator written in Rust for 3D printers
The short answer is that they are not building more fabs for non-leading edge processes, like those used by STM32.

There is an interesting video about this:

https://www.youtube.com/watch?v=YJrOuBkYCMQ

jhallenworld··on The trouble with symbolic links
Only if there are no loops..
jhallenworld··on The trouble with symbolic links
I'm not a macOS user, but these sure seem to add complexity:

https://stackoverflow.com/questions/80875/what-is-the-unix-c...

The filesystem has to check for and disallow loops.

jhallenworld··on The trouble with symbolic links
Hardlinks exist, so you already have this problem. Tar has to keep track of inode numbers to recreate hard links for example.
jhallenworld··on The trouble with symbolic links
Another problem with hard links: you can not hard link a directory. It would make ".." ambiguous.

Also with hard link directories, you would want to be able "rmdir" non-empty directories, just to delete the link. But then you have the problem of reference loops, so how do you reclaim space reliably? You would need a garbage collection algorithm to find data not reachable by root.

jhallenworld··on Ask HN: What are some cool but obscure data structures you know about?
I find I use fixed-sized arrays a lot on microcontrollers. You want to avoid the heap (for reliability) and you don't have a lot of RAM, so you must carefully size your fixed-size arrays.
jhallenworld··on Ask HN: What are some cool but obscure data structures you know about?
Some ones I've used recently:

The "golden section search" to find a the minimum (or maximum) of a unimodal function. An actual real-world use case for the golden ratio.

Exponentially Weighted Moving Average filters. Or how to have a moving average without saving any data points..

Some of my classic favorites:

Skiplists: they are sorted trees, but the algorithms are low complexity which is nice.

Boyer-Moore string search is awesome..

Bit twiddling algorithms from Hackers Delight: for example (x &-x) isolates the least significant set bit: basically use the ALU's carry chain to determine priority.

Another is compress from Hacker's Delight. It very quickly compresses selected bits (from a bitmask), all to the right of the word. It's useful to make certain hash functions.

The humble circular queue. If your circular queue is a power of 2 in size, then the number of bits needed for indexes is at least log2(size) + 1. The + 1 is key- it allows you to distinguish between completely full and completely empty with no effort. So:

    Empty: (write_index == read_index)
    Full: (write_index == read_index + size)
    Count: (write_index - read_index)
    Insert: queue[write_index++ & (size - 1)] = data
    Remove: data = queue[read_index++ & (size - 1)];
All lossless data compression algorithms are amazing.
jhallenworld··on Edbrowse – A Command Line Editor Browser
This is very cool, but dedicated newsreaders (like trn) were easier to use to browse USENET than edbrowse is to browse Hacker News..

If you were forced to surf the web using a teletype, this is your tool.

Edit: actually it's growing on me. My one complaint is that I wish it would retain the printing mode when you follow a link. For example, type "g2" to follow the 2nd link on the line. Right now I should be able to hit Enter or z to display lines from this link, but annoyingly you have to enter something like "1" to start it going.

jhallenworld··on Half of Americans anticipate a U.S. civil war soon
I suppose the closest example was the Spanish Civil War. Would different military bases choose different sides?

https://man.fas.org/dod-101/fac/conus.htm

Also, what would Trump's tomb look like (assuming he's leading one side and wins). For example:

https://www.theguardian.com/commentisfree/2019/oct/24/franco...

jhallenworld··on PicoCart64: Nintendo 64 flash cart using a Raspberry Pi RP2040
The UnoCart is the Atari 800 version of this:

https://github.com/robinhedwards/UnoCart

Uses an STM32, a tight loop responds to changes on the Atari's address bus to emulate a ROM, all through STM32 GPIO. Atari 800 has a 1.8 MHz bus, but it's still cool that microcontrollers are fast enough for this to work.

Alternative straightforward way is to use an FPGA, the UltimateCart:

https://github.com/robinhedwards/UltimateCart

jhallenworld··on Parsing XML at the Speed of Light (2012)
I worked on a hardware XML accelerator. It would deposit the parsed and validated XML tree into CPU memory, ready for use by software.

https://patents.google.com/patent/US9110875B2

The hardware was an FPGA-based PCIe board, but the design also ended up in a custom CPU.

Here's one thing I remember: namespace prefix declarations are applied retroactively within XML elements. This is not easy to deal with when trying to design streaming hardware..

jhallenworld··on WordPerfect for UNIX (1992)
Thanks, will try this. Wish xterm was on the list, but mlterm is OK.
jhallenworld··on WordPerfect for UNIX (1992)
Rlogin looks promising. One other requirement I forgot is that it needs to support x/y/z-modem, and Rlogin does.
jhallenworld··on WordPerfect for UNIX (1992)
Yeah, mintty is too difficult (the user would need to use picocom or something to connect to the serial port). iTerm2 is MAC only...
jhallenworld··on WordPerfect for UNIX (1992)
Sixel should be more universal: in particular I'm wishing that PuTTY and especially TeraTERM on Windows supported it. It would allow non-sw engineers (hence Windows) to see graphics from embedded systems that use serial ports.
jhallenworld··on DRAM thermal issues reach crisis point
Maybe DRAM becomes non-viable, so switch to SRAM. Which is denser, 14 nm DRAM or 5 nm SRAM?
jhallenworld··on ‘Things are going to break’: Texas power plants are running nonstop
This is their plan to get more people to install stand-alone PV systems.

Grids (electric, gas, etc.) are communal things, and Texans resist communism.

jhallenworld··on Why does ancient Egypt's distinctive art style make everything look flat?
2d is what you get if you see the entire scene from very far away, for example the stars where thought to be on a fixed shell.

But who is very far away, but can see everything? Clearly the gods.. By making the images the way they do elevates the humans who see them to gods.

jhallenworld··on Gamedevs not baking in monetization are “fucking idiots”, says Unity CEO
Having read Wheel of Time recently.. "[The Forsaken] Graendal in the Age of Legends was famous as a great psychologist and a noted ascetic. After her conversion to the Shadow, she became a master manipulator and an extraordinarily skilled user of Compulsion weaves... She is very particular about her servants, often choosing people of great status, power, or renown and reducing their minds to empty husks"
jhallenworld··on CP/M is really open-source now
HP should open OS/8 and RT-11, the two big influences on CP/M. OS/8 is kind of remarkable, running on a system arguably less powerful than the first 8-bit home computers (I would say they are closer to PIC microcontrollers, but with more RAM):

https://www.pdp8online.com/os/os8/index.shtml

PDP-8 memory is heavily paged. There are 128 word pages- direct addresses can only reach within the current page, and literals (immediate data including addresses to other pages) have to be allocated out of this current page along with the instructions. Second, there are 4K-word fields. So you need to use far jumps and returns to access outside the current field. This is just like PIC microcontroller pages.

OS/8 reserved only two pages for itself. Things like the command interpreter were swapped out to disk or DECTape.

https://en.wikipedia.org/wiki/DECtape

If the application needed device drivers, it got to choose which pages the drivers would occupy- meaning the device drivers had to be written as position independent code. Also I think each driver was limited to two pages..

jhallenworld··on Show HN: Maze Generation Visualization
How about in Atari 800 BASIC with sound...

https://www.youtube.com/watch?v=Yf_OPNQA1-4

jhallenworld··on Ed is the standard text editor (2014)
Someone used to host a TOPS-20 emulator online, but I can no longer find it.. (these days there should be DEC-20 in the web-browser).

Anyway, here are some links:

http://www.columbia.edu/cu/computinghistory/dec20.html

https://www.livingcomputers.org/Computer-Collection/Online-S...

TOPS-20 was really nice.

jhallenworld··on Ed is the standard text editor (2014)
Yeah, also for PDP-8s and PDP-11s, which were very popular at the time.

TECO-like editors are interesting to use:

Unlike line editors (like ex/ed/edlin, etc.), the edit position can be anywhere, not just at line boundaries. But there is no screen, so you really need a good imagination to keep track of this..

Also, they can edit files larger than can fit in the edit buffer, but not in the way this works on modern editors, where the editor manages everything. Instead, the editor makes one pass through the large file, copying it from input to output. You get to make changes along the way, in the part of it that fits in the edit buffer.

TECO has a page concept to help with this: you break your large file into pages separated with form feeds, and there are commands to retrieve the next page from the input file and write the old page to the output file. But I've seen TECO clones without the page concept on early micros.

Vestiges of this page concept remain in emacs to this day..

jhallenworld··on BootBASIC Interpreter in 512 Bytes
Well check out VTL for the Altair 680. BASIC-like in 768 bytes.

https://youtu.be/GJ02QLHRVOw

It's interesting because instead of GOTO, you assigned the target line number to a special variable. Instead of IF, you multiplied the result of a test with the line number and assigned the result to the special variable. An assignment of 0 is ignored.

jhallenworld··on FCC commissioner wants TikTok removed from app stores over spying concerns
Well I think in general you have more personally to worry about from your own government (which can legally apply coercive force against you), vs. any foreign government, particularly an adversarial one, with no extradition treaty.

Which is not to say that your own government shouldn't worry about national security- maybe the ban on TikTok could be more targeted, for example members of the government and military should not use it.

Anyway I was thinking more about the spying, and not so much about the influencing.

jhallenworld··on FCC commissioner wants TikTok removed from app stores over spying concerns
Oops, yes. Fixed.
jhallenworld··on FCC commissioner wants TikTok removed from app stores over spying concerns
As a USA resident, which is more likely to adversely affect you: CCP collecting data on you, or US government collecting data on you?
jhallenworld··on PDP-8 Small-C Compiler (2012)
I'll have to look at this for my relay computer, which is similar in some ways to PDP-8 (but has even less memory).

http://relaysbc.sourceforge.net/

But how do any PDP-8 compilers deal with the paged memory system? I mean one luxury of 6502 is PC-relative branches. On the PDP-8, jumps reach only within the current page.

PC relative is nicer because it has this property: shortening a branch is guaranteed not to make other branches longer. So you can optimize branches using a relaxing algorithm: you repeatedly try to shorten every branch in the code. If any were shortened, you repeat the whole process since prior shortenings may have made other branches shortenable.

On the PDP-8 this rule does not hold, shortening a branch can cause other branches to become longer, because the different code position may push the target into a different page.

PIC microcontrollers also have this problem.. but on the PDP-8 the problem is worse in that the page sizes are smaller.

Hmm, well here is one algorithm: in one phase shorten branches, but do not change the code size (insert NOPs to make the long branch the same size as the short branch). So this will increase performance, but not reduce code size. In second phase try to delete the NOPs. Only delete a NOP if it will not break any branch. This is not optimal, but maybe good enough..

Ugh, it's even worse because long branches on the PDP-8 involve indirect addressing, where the long address has to fit in the current page. Wow even PIC is nicer..

Anyway for Small-C, they talk about these issues here:

https://so-much-stuff.com/pdp8/C/Assembler.php

← PreviousPage 17 of 34Next →