-
Posts
132 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Gallery
Events
Store
Posts posted by apc
-
-
Time to move to 4.00 ?
Thanks a lot for helping on this topic!
Jan
-
It looks like a bug in tnfs/tnfsd/datagram.c
I can trigger crazy tnfsd output with netcat (or telnet) to TCP port 16384 (which is open by tnfsd):
$ nc localhost 16384 # just hit ctrl+c to close the connection ^C $
And you will get:
DEBUG: rx of tcpmsg: 0 bytes: � DEBUG: rx of tcpmsg: 0 bytes: � DEBUG: rx of tcpmsg: 0 bytes: � DEBUG: rx of tcpmsg: 0 bytes: � ...
Currently, if you are running any network probes to the TCP port 16384 (network scanning or service monitoring) it will make tnfsd very unhappy.
-
1 hour ago, phaeron said:
the raw bus commands on the SIO class require raw mode to be turned on ($sio.enable_raw(true)).
I am calling $sio.enable_raw(true) in cold_reset (only there). I believe, it is running in raw mode, the waits are working. The output corresponds to SIO activities. It is not like one shot and stop (by VM). Only $timestamp is not updated.
Running this test...
function void command_thread_handler() { Debug.log("Hi"); loop { $sio.wait_command(); Debug.log_int("thread CMD ON ", $timestamp); $sio.wait_command_off(); Debug.log_int("thread CMD OFF ", $timestamp); } } event "sio_command_changed": function { if ($sio.command_asserted()) { Debug.log_int("event CMD ON ", $timestamp); } else { Debug.log_int("event CMD OFF ", $timestamp); } };
...is producing result like this. Only $timestamp in thread is not changing but waits in thread corresponds with command level changes captured by event handler.
CUSTOMDEV: Hi CUSTOMDEV: event CMD ON 82819965 CUSTOMDEV: thread CMD ON 46135568 CUSTOMDEV: event CMD OFF 82828552 CUSTOMDEV: thread CMD OFF 46135568 CUSTOMDEV: event CMD ON 82870396 CUSTOMDEV: thread CMD ON 46135568 CUSTOMDEV: event CMD OFF 82877359 CUSTOMDEV: thread CMD OFF 46135568 ...
Maybe it is expected behavior. From help:
QuoteIn particular, the $timestamp variable is thread-local. In an SIO script, it always gives the timestamp of the start of script execution regardless of suspend points within the script.
1 hour ago, phaeron said:That's a bug, unfortunately -- the script compiler is not throwing an error as it should here.
Ok, I see.
-
Wait, in sample device rverter.atdevice in "network_interrupt" handler the send_raw_byte() is called. I am confused now. Is network_interrupt handler different from other handlers as the source of the event is not emulator (but device server)?
-
1 hour ago, apc said:
NTFS
TNFS
-
33 minutes ago, phaeron said:
$timestamp should work in either case, it's set whenever a thread resumes execution
$timestamp variable was not changing when used in thread, not sure what can be wrong:
function void command_thread_handler() { loop { $sio.wait_command(); $network.post_message($11, 0); Debug.log_int("CMD ON ", $timestamp); $sio.wait_command_off(); $network.post_message($10, 0); Debug.log_int("CMD OFF ", $timestamp); } }
QuoteBoth methods will block execution, as emulation is single-threaded due to synchronization and determinism.
OK.
36 minutes ago, phaeron said:The main difference between using an event handler and a thread is that event handlers can't do anything that requires emulation to pass, so they can't execute asynchronous calls like send_raw_byte(). The event handler has to delegate to a thread to do this.
Oops, I have to fix my "network_interrupt" handler which is calling send_raw_byte() directly! (but it was working somehow). I assume to set a PIN with set_proceed() or set_command() should be fine from event handler.
-
31 minutes ago, mozzwald said:
compile it without DEBUG ?
It will not help in this case, ... tnfs/tnfsd/datagram.c
printf("DEBUG: rx of tcpmsg: %d bytes: %s\n", sz, buf);
I am wondering are you connecting to or listening on TCP? NTFS runs usually over UDP.
Edit: Hmm, tnfsd seems to be listening always on both, UDP and TCP. The question is what triggers TCP handler in your case (as there is 0 bytes available from your logs)? Strange select()?
-
I am trying to debug and understand some timing issues.
@phaeron I have a dilemma, better to use event handler, like "sio_command_changed" or separate thread with loop doing $sio.wait_command(); ... $sio.wait_command_off(); ... ?
To be able to use $timestamp I switched from thread/loop to event handler... not sure is there any significant difference between above two methods. Event handler blocks the emulator execution, thread based handler does not?
Jan
- 1
-
Missing hardware buttons on fujinet-pc ... at least I added Restart button into web interface.
If interested, pick the code from GitHub, build it and run it with:
./run-fujinet
run-fujinet is simple wrapper script to start fujinet executable and to restart it if it previously exited with specific exit code.
? Jan
- 3
-
4 hours ago, JohnBuell said:
Thom was kind enough to show me where to alter the code. From the root directory in fujinet-pc, it's /lib/http/httpService.cpp - change "8000" and recompile the file for each instance you want to run. Now I have one instance with a web service on 8881, and a second on 8882, both running over SIO2PC/USB cables.
Command line option was added -u URL , to specify URL the web server should listen on.
Updated code is available as usually on https://github.com/FujiNetWIFI/fujinet-pc
After new build, you can start fujinet with -u option like this:
# to serve web on all available interfaces/addresses, on port 8881 ./fujinet -u http://0.0.0.0:8881 # to serve web interface only on specific interface/address, on port 8882 ./fujinet -u http://192.168.192.168:8882 # to limit the web interface only for machine which is running fujinet ./fujinet -u http://127.0.0.1:8000 # or ./fujinet -u http://localhost:8000
:-)
- 4
-
5 hours ago, phaeron said:
After recv_raw_byte(), the cycles per byte is in the thread-local $aux variable.
Nice
-
@phaeron I started to play with this. Found your sampledevices and deviceservers (+ Altirra help) very helpful to make first steps. Thanks for it!
I am dealing now with serial port speed change and how to detect it. Altirra always provides proper output bytes to custom device - provided output does not depend on speed.
On FujiNet side the toggle between standard speed and high speed is based on detecting checksum errors in received frames - but this does not happen with custom device.
Do you have some idea how to detect the serial output speed change in custom device? Then it would be possible to notify the receiver to toggle its speed too.
Jan
- 1
-
-
5 minutes ago, a8isa1 said:
It's working now.
Nice ?
-
I guess you are running some older version. HTTP protocol handler was added later in April.
Try it with latest code https://github.com/FujiNetWIFI/fujinet-pc
As a bonus APOD - http://www.newbreedsoftware.com/fujinet-apod/ should work too ?
Jan
- 1
-
3 hours ago, a8isa1 said:
Is fujinet-pc at the point of development where it can support Bill Kendrick's ISS.XEX?
Yes. It should work. Plain HTTP request-response called by ISS.XEX is handled by fujinet-pc just fine.
You should get similar output in terminal to each ISS update (Open, Status, Read, Close):
CF: 71 4f 04 00 c4 sioNetwork::sio_process 0x4f 'O': 0x04, 0x00 sioNetwork::sio_open() write: 1 ACK! Deleting existing rateTimer <-SIO read 256 bytes read: 0 read: 24 read: 30 read: 30 read: 31 read: 30 read: 30 read: 30 read: 30 read: 21 read: 1 write: 1 ACK! sioNetwork::parseURL(N:HTTP://api.open-notify.org/iss-now.json) sioNetwork::parseURL transformed to (N:HTTP://api.open-notify.org/iss-now.json, HTTP://api.open-notify.org/iss-now.json) Parse and instantiate protocol: N:HTTP://api.open-notify.org/iss-now.json NetworkProtocol::ctor() sioNetwork::open_protocol() - Protocol HTTP opened. NetworkProtocolHTTP::mount(HTTP://api.open-notify.org/iss-now.json) mgHttpClient::begin "http://api.open-notify.org/iss-now.json" NetworkProtocolFS::resolve(/iss-now.json,/,iss-now.json) Resolved to http://api.open-notify.org/iss-now.json NetworkProtocolHTTP::open_file_handle() write: 1 COMPLETE! SIO CMD processed in 149 ms +read: 0 read: 5 CF: 71 53 00 00 c4 sioNetwork::sio_process 0x53 'S': 0x00, 0x00 write: 1 ACK! sioNetwork::sio_status_channel(0) PROTOCOL Channel mode is 0 mgHttpClient::GET 000b2d39 _perform Connected Status: 200 Received: 295 Header0: Server = nginx/1.10.3 Body: 113 bytes 000b2e9f _perform status = 200, length = 0, chunked = 0 sio_status_channel() - BW: 113 C: 1 E: 1 ->SIO write 4 bytes write: 1 COMPLETE! write: 4 write: 1 SIO CMD processed in 369 ms -read: 0 read: 5 CF: 71 52 71 00 35 sioNetwork::sio_process 0x52 'R': 0x71, 0x00 sioNetwork::sio_read( 113 bytes) write: 1 ACK! NetworkProtocolFS::read_file(113) NetworkProtocolHTTP::read_file_handle(0x55bbcef9eb90,113) NetworkProtocolHTTP::read_file_handle_data() ::read from buffer 113 NetworkProtocol::read(113) ->SIO write 113 bytes write: 1 COMPLETE! write: 113 write: 1 SIO CMD processed in 66 ms +read: 0 read: 5 CF: 71 43 00 00 b4 sioNetwork::sio_process 0x43 'C': 0x00, 0x00 sioNetwork::sio_close() write: 1 ACK! NetworkProtocolHTTP::close_file_Handle() mgHttpClient::close NetworkProtocolHTTP::umount() mgHttpClient::close 2021-06-30 16:27:56 I mongoose.c:2091:mg_mgr_fr All connections closed write: 1 COMPLETE! NetworkProtocol::dtor() SIO CMD processed in 6 ms
Jan
-
Nice! Thx
NB: C'est la Vie - happy to make money like this ?
-
Thank you for nice feedback, support from AA members and to all interested into making FujiNet the real thing!
On 4/21/2021 at 12:26 AM, apc said:? Jan
11 hours ago, Mazzspeed said:Now, if only my coding skills were better!
You can start anytime! I am always surprised I can do LDX addr,Y
- 5
-
On 4/25/2021 at 1:36 PM, Mazzspeed said:
Is this part of Fujinet-PC yet? Don't crucify me, just askin'.
Yes ... for couple of last minutes
You can just grab above attached file and replace old autorun.atr file - rename autorun-zx0.atr to autorun.atr and put it into fujinet-pc/build directory (if running fujinet from there)
- 1
-
On 4/21/2021 at 5:25 PM, tschak909 said:
Normal 1X Speed:
High Speed:
I do not see much difference. It is so fast capture device cannot get it
On 4/21/2021 at 11:30 AM, xxl said:video or didn't happen
It must be true. It's on YouTube!
Config loader presented in a format which young generation can understand.
? Jan
- 7
-
Just now, mozzwald said:
indeed, adding the dir makes it work
good, should be fixed in repo
- 1
-
workaround: mkdir tools/pack/a8
going to put some placeholder file there to keep the a8 dir in git
- 1
-
4 minutes ago, mozzwald said:
Building relocatable ZX0 decompressor ../tools/relgen.py zx0unpack-1000-f.obj zx0unpack-1201-f.obj ../tools/pack/a8/zx0unpack.obj Traceback (most recent call last): File "../tools/relgen.py", line 208, in <module> main() File "../tools/relgen.py", line 142, in main with open(fnout, 'wb') as fout: FileNotFoundError: [Errno 2] No such file or directory: '../tools/pack/a8/zx0unpack.obj' Makefile:60: recipe for target '../tools/pack/a8/zx0unpack.obj' failed
this is as far as I got
ok, give me a minute, i guess, git does not store empty directory ...
- 1
-
23 minutes ago, tschak909 said:
how do I test?
-Thom
- mount as D1: and boot - CONFIG should load
- mount as D2: with some DOS disk in D1: boot DOS and load CONFIG - CONFIG should load
- replace autorun.atr with autorun-zx0.atr (rename to autorun.atr), build firmware image, test with firmware
@mozzwald can you test if the loader build process works (git clone ... make dist) on your side? then we can test if build process works on WSL .. would be nice
- 1
tnfsd likes writing logs a little too much
in #FujiNet SIO Network Adapter
Posted
Take care when making your TNFS server reachable from wild world. Ensure only UDP port 16384 is exposed.
In general, follow security practices:
- restrict TNFS to vm/container/jail/chroot/etc.
- run it with dedicated user
- limit the permissions on files/dirs to allow only read access
- be prepared, bad ass will exploit it
- do backups
I am not security expert, I'm sure someone can add more rulz