Giter VIP home page Giter VIP logo

nabud's People

Contributors

cml37 avatar masto avatar thorpej avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nabud's Issues

Prevent bind to ipv6?

I'm getting these ugly messages at startup:

INFO: conn_add_tcp: Creating TCP listener on port 5816.
INFO: adaptor_event_loop: [/dev/ttyUSB0] Connection starting.
INFO: conn_create_common: [IPv4-5816] Using '/home/hirsch/nabu/nhacp' for local storage.
INFO: image_channel_select: [IPv4-5816] Selected channel 1 (nabu on Local).
ERROR: conn_add_tcp: Unable to bind IPv6-5816: Address already in use
mj_string_size: weird type 9
mj_snprint: weird type 9
ERROR: config_error: Invalid Connection object.:

How can I prevent nabud from attempting to use IPv6 ports?

Linker error on a macos 10.15.7

After ./config and build ... get the following linking error :

Making all in nabud
/bin/sh ../libtool  --tag=CC   --mode=link gcc -pthread -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes 		     -Wpointer-arith -Wno-sign-compare -Wreturn-type -Wswitch 		     -Wshadow -Wcast-qual -Wwrite-strings 		     -Wformat=2 -Wno-format-zero-length -Wno-deprecated-declarations -g -O2 -std=gnu99   -o nabud nabud-adaptor.o nabud-conn.o nabud-control.o nabud-image.o nabud-main.o nabud-nhacp.o nabud-retronet.o nabud-stext.o ../libnabud/libnabud.la ../libfetch/libfetch.la ../libmj/libmj.la  -framework Security -framework CoreFoundation   -lpthread 
libtool: link: gcc -pthread -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wformat=2 -Wno-format-zero-length -Wno-deprecated-declarations -g -O2 -std=gnu99 -o nabud nabud-adaptor.o nabud-conn.o nabud-control.o nabud-image.o nabud-main.o nabud-nhacp.o nabud-retronet.o nabud-stext.o  ../libnabud/.libs/libnabud.a ../libfetch/.libs/libfetch.a ../libmj/.libs/libmj.a -framework Security -framework CoreFoundation -lpthread -pthread
ld: warning: ignoring file ../libmj/.libs/libmj.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64
ld: warning: ignoring file ../libnabud/.libs/libnabud.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
ld: warning: ignoring file ../libfetch/.libs/libfetch.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture x86_64:
  "_atom_consume", referenced from:
      _control_connection_thread in nabud-control.o
  "_atom_data_type", referenced from:
      _control_connection_thread in nabud-control.o
  "_atom_dataref", referenced from:
      _control_connection_thread in nabud-control.o
  "_atom_list_append", referenced from:
      _control_connection_thread in nabud-control.o
  "_atom_list_append_bool", referenced from:
      _control_serialize_channel in nabud-control.o
      _control_serialize_connection in nabud-control.o
  "_atom_list_append_done", referenced from:
      _control_connection_thread in nabud-control.o
      _control_serialize_channel in nabud-control.o
      _control_serialize_connection in nabud-control.o
  "_atom_list_append_error", referenced from:
      _control_connection_thread in nabud-control.o
  "_atom_list_append_number", referenced from:
      _control_serialize_channel in nabud-control.o
      _control_serialize_connection in nabud-control.o
  "_atom_list_append_string", referenced from:
      _control_connection_thread in nabud-control.o
      _control_serialize_channel in nabud-control.o
      _control_serialize_connection in nabud-control.o
  "_atom_list_append_void", referenced from:
      _control_serialize_channel in nabud-control.o
      _control_serialize_connection in nabud-control.o
  "_atom_list_count", referenced from:
      _control_connection_thread in nabud-control.o
  "_atom_list_free", referenced from:
      _control_connection_thread in nabud-control.o
  "_atom_list_init", referenced from:
      _control_connection_thread in nabud-control.o
  "_atom_list_next", referenced from:
      _control_connection_thread in nabud-control.o
  "_atom_list_recv", referenced from:
      _control_connection_thread in nabud-control.o
  "_atom_list_send", referenced from:
      _control_connection_thread in nabud-control.o
  "_atom_number_value", referenced from:
      _control_connection_thread in nabud-control.o
  "_atom_tag", referenced from:
      _control_connection_thread in nabud-control.o
  "_atom_typedesc", referenced from:
      _control_connection_thread in nabud-control.o
  "_conn_io_accept", referenced from:
      _conn_tcp_thread in nabud-conn.o
      _control_listen_thread in nabud-control.o
  "_conn_io_cancel", referenced from:
      _control_req_connection_cb in nabud-control.o
  "_conn_io_fini", referenced from:
      _conn_destroy in nabud-conn.o
      _control_init in nabud-control.o
      _control_listen_thread in nabud-control.o
      _control_connection_thread in nabud-control.o
  "_conn_io_init", referenced from:
      _conn_create_common in nabud-conn.o
      _control_init in nabud-control.o
      _control_listen_thread in nabud-control.o
  "_conn_io_recv", referenced from:
      _adaptor_msg_mystery in nabud-adaptor.o
      _adaptor_msg_packet_request in nabud-adaptor.o
      _adaptor_msg_change_channel in nabud-adaptor.o
      _nhacp_start in nabud-nhacp.o
      _rn_req_file_open in nabud-retronet.o
      _rn_req_fh_size in nabud-retronet.o
      _rn_req_fh_read in nabud-retronet.o
      ...
  "_conn_io_recv_byte", referenced from:
      _adaptor_event_loop in nabud-adaptor.o
      _adaptor_msg_get_status in nabud-adaptor.o
      _adaptor_expect_ack in nabud-adaptor.o
      _nhacp_start in nabud-nhacp.o
      _rn_recv_filename in nabud-retronet.o
      _rn_file_copy_mode_getargs in nabud-retronet.o
  "_conn_io_send", referenced from:
      _adaptor_msg_reset in nabud-adaptor.o
      _adaptor_msg_mystery in nabud-adaptor.o
      _adaptor_msg_get_status in nabud-adaptor.o
      _adaptor_msg_start_up in nabud-adaptor.o
      _adaptor_msg_packet_request in nabud-adaptor.o
      _adaptor_msg_change_channel in nabud-adaptor.o
      _adaptor_send_packet in nabud-adaptor.o
      ...
  "_conn_io_send_byte", referenced from:
      _adaptor_msg_reset in nabud-adaptor.o
      _adaptor_msg_mystery in nabud-adaptor.o
      _adaptor_msg_get_status in nabud-adaptor.o
      _adaptor_msg_start_up in nabud-adaptor.o
      _adaptor_msg_packet_request in nabud-adaptor.o
      _adaptor_msg_change_channel in nabud-adaptor.o
      _adaptor_send_unauthorized in nabud-adaptor.o
      ...
  "_conn_io_shutdown", referenced from:
      _main in nabud-main.o
  "_conn_io_start", referenced from:
      _conn_create_common in nabud-conn.o
      _control_init in nabud-control.o
      _control_listen_thread in nabud-control.o
  "_conn_io_start_watchdog", referenced from:
      _adaptor_event_loop in nabud-adaptor.o
      _nhacp_start in nabud-nhacp.o
  "_conn_io_stop_watchdog", referenced from:
      _adaptor_event_loop in nabud-adaptor.o
      _nhacp_start in nabud-nhacp.o
  "_fileio_close", referenced from:
      _rn_req_file_copy in nabud-retronet.o
      _rn_file_getattr in nabud-retronet.o
      _stext_file_open in nabud-stext.o
      _stext_fileop_close_fileio in nabud-stext.o
  "_fileio_getattr", referenced from:
      _stext_fileop_getattr_fileio in nabud-stext.o
  "_fileio_getattr_path", referenced from:
      _rn_req_file_list in nabud-retronet.o
  "_fileio_load_file", referenced from:
      _stext_file_open in nabud-stext.o
  "_fileio_load_file_from_location", referenced from:
      _image_channel_copy_listing in nabud-image.o
      _image_load in nabud-image.o
      _main in nabud-main.o
  "_fileio_location", referenced from:
      _stext_file_open in nabud-stext.o
      _stext_fileop_location_fileio in nabud-stext.o
  "_fileio_location_is_local", referenced from:
      _rn_recv_filename in nabud-retronet.o
  "_fileio_open", referenced from:
      _rn_req_file_copy in nabud-retronet.o
      _rn_file_getattr in nabud-retronet.o
      _stext_file_open in nabud-stext.o
  "_fileio_pread", referenced from:
      _stext_fileop_pread_fileio in nabud-stext.o
  "_fileio_pwrite", referenced from:
      _stext_fileop_pwrite_fileio in nabud-stext.o
  "_fileio_read", referenced from:
      _rn_req_file_copy in nabud-retronet.o
      _stext_fileop_read_fileio in nabud-stext.o
  "_fileio_resolve_path", referenced from:
      _rn_req_file_delete in nabud-retronet.o
      _rn_req_file_copy in nabud-retronet.o
      _rn_req_file_move in nabud-retronet.o
      _rn_req_file_list in nabud-retronet.o
  "_fileio_seek", referenced from:
      _stext_fileop_seek_fileio in nabud-stext.o
  "_fileio_truncate", referenced from:
      _stext_fileop_truncate_fileio in nabud-stext.o
  "_fileio_write", referenced from:
      _rn_req_file_copy in nabud-retronet.o
      _stext_fileop_write_fileio in nabud-stext.o
  "_log_debug_enable", referenced from:
      _main in nabud-main.o
  "_log_fini", referenced from:
      _main in nabud-main.o
  "_log_init", referenced from:
      _main in nabud-main.o
  "_log_message", referenced from:
      _adaptor_event_loop in nabud-adaptor.o
      _adaptor_msg_reset in nabud-adaptor.o
      _adaptor_msg_mystery in nabud-adaptor.o
      _adaptor_msg_get_status in nabud-adaptor.o
      _adaptor_msg_start_up in nabud-adaptor.o
      _adaptor_msg_packet_request in nabud-adaptor.o
      _adaptor_msg_change_channel in nabud-adaptor.o
      ...
  "_log_subsys_list", referenced from:
      _usage in nabud-main.o
  "_mj_arraycount", referenced from:
      _main in nabud-main.o
  "_mj_asprint", referenced from:
      _main in nabud-main.o
  "_mj_delete", referenced from:
      _main in nabud-main.o
  "_mj_get_atom", referenced from:
      _main in nabud-main.o
  "_mj_parse", referenced from:
      _main in nabud-main.o
ld: symbol(s) not found for architecture x86_64

Linux serial port regression

Commit 6fc7139 broke the serial port on Linux again. Reverting it makes nabud work.

INFO: conn_add_serial: Creating Serial connection on /dev/ttyS0.
ERROR: conn_add_serial: cfsetspeed(NABU_NATIVE_BPS) on /dev/ttyS0 failed.
ERROR: conn_add_serial: cfsetspeed(NABU_FALLBACK_BPS) on /dev/ttyS0 failed.
ERROR: main: No connections! So boring! Goodbye.

Both cfsetispeed(&t, NABU_FALLBACK_BPS) and cfsetospeed(&t, NABU_FALLBACK_BPS) fail with EINVAL.

NABU not booting

@thorpej Thanks for this work!

I've made a small modification to it to allow for a remote TCP connection to the virtual Nabu server. I'm actually using a router that has an RS422 port on it and that is connected to the Nabu. Only, it looks like it is working but somehow failing.

Below is the capture of the TCP from Wireshark that is going to/from the Nabu router. I've also checked the quality of the signal with a scope between the router and the Nabu and it looks good on the RxA/RxB and TxA/TxB lines (Voltage difference on these lines was surprisingly high, delta 15V but still, compliant and clear).

Not sure what the problem is here. Data appears to be getting to the Nabu and returning. Below is a picture of the interactions to it getting the first chunk of data. My bios rom has a label showing '90020060 REV A'. The RED lines are sent from the Nabu, the BLUE indented lines are sent to the Nabu.

The screen on the Nabu is simply blue, no text, sometimes it will say "Please Wait" then show adapter failure or it will show garbled image. Here is a capture of the data on the RS422 line ..

Screen Shot 2023-03-27 at 6 42 21 PM

A little later, it appears to re-try?

Screen Shot 2023-03-27 at 6 43 20 PM

But then it changes ..

Screen Shot 2023-03-27 at 6 44 20 PM

And ends here ...

Screen Shot 2023-03-27 at 6 45 16 PM

Docker images would be nice

I've gotten quite lazy when it comes to building and deploying software these days. Most of it comes ready to go on Docker Hub, or at least has a Dockerfile so I don't have to know anything about how to compile it.

Custom baud rate fix for Linux (not sexy)

Having had issues setting the 111860 baud rate on my linux machine, I finally found some working combination of black magic to get there :

#include <stropts.h>
#include <asm/termios.h>
...
struct termios2 tio;
ioctl(fd, TCGETS2, &tio);
tio.c_cflag &= ~CBAUD;
tio.c_cflag |= BOTHER;
tio.c_ispeed = speed;
tio.c_ospeed = speed;
int r = ioctl(fd, TCSETS2, &tio);
...

This is a mix of gists / stackoverflow / ... stuff but seems to work.

You are supposed to do the POSIX stuff first, then that ugly not portable stuff.

Nabud doesn't use local .dsk files for Cloud CP/M and always downloads fresh images

Playing around with CP/M it appears that local .dsk files are not supported properly. The local .dsk files are not used and always redownloaded from retronet which renders the read/write C: non-functional. The debug output is with the three .dsk files grabbed directly from retronet's cloud cp/m page.

Channel config:

    {
      "Name": "HomeBrew",
      "Path": "HomeBrew/titles",
      "ListURL": "https://cloud.nabu.ca/HomeBrew/titles/filesv2.txt",
      "Number": 9,
      "Type": "nabu",
      "Source": "NabuRetroNet",
      "RetroNetExtensions": true,
    },

nabuctl> connection 1 file 1
/dev/ttyUSB0: Selecting file 'CPM22.nabu'
nabuctl> quit

Relevant storage area:

nabu@raspberrypi:~/storage/living-room-nabu$ ls
a.dsk  b.dsk  BIOS_CPM22.BIN  c.dsk  diskdefs
nabu@raspberrypi:~/storage/living-room-nabu$ 

Relevant debug logs:

DEBUG: rn_recv_filename: [/dev/ttyUSB0] fileName before normalization: 'BIOS_CPM22.BIN'
DEBUG: rn_recv_filename: [/dev/ttyUSB0] fileName after normalization: 'BIOS_CPM22.BIN'
INFO: stext_file_open: [/dev/ttyUSB0] Opening 'BIOS_CPM22.BIN'
...
DEBUG: rn_recv_filename: [/dev/ttyUSB0] fileName before normalization: 'A.dskX?'
DEBUG: rn_recv_filename: [/dev/ttyUSB0] fileName after normalization: 'A.DSKX?'
DEBUG: adaptor_event_loop: [/dev/ttyUSB0] Waiting for NABU.
DEBUG: retronet_request: [/dev/ttyUSB0] Got NABU_MSG_RN_FILE_SIZE.
DEBUG: rn_recv_filename: [/dev/ttyUSB0] name length: 30
DEBUG: adaptor_event_loop: [/dev/ttyUSB0] Waiting for NABU.
DEBUG: retronet_request: [/dev/ttyUSB0] Got NABU_MSG_RN_FILE_OPEN.
DEBUG: rn_recv_filename: [/dev/ttyUSB0] name length: 30
DEBUG: stext_file_open: [/dev/ttyUSB0] Need R/W shadow buffer for 'http://cloud.nabu.ca/cpm/A.dsk'
DEBUG: stext_file_open: [/dev/ttyUSB0] Need seekable shadow buffer for 'http://cloud.nabu.ca/cpm/A.dsk'
DEBUG: fileio_load_file: Size of http://cloud.nabu.ca/cpm/A.dsk is 8388608 bytes.
...
DEBUG: rn_recv_filename: [/dev/ttyUSB0] fileName before normalization: 'C.dsk????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????'
DEBUG: rn_recv_filename: [/dev/ttyUSB0] fileName after normalization: 'C.DSK????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????'
DEBUG: adaptor_event_loop: [/dev/ttyUSB0] Waiting for NABU.
DEBUG: retronet_request: [/dev/ttyUSB0] Got NABU_MSG_RN_FILE_SIZE.
DEBUG: rn_recv_filename: [/dev/ttyUSB0] name length: 30
DEBUG: adaptor_event_loop: [/dev/ttyUSB0] Waiting for NABU.
DEBUG: retronet_request: [/dev/ttyUSB0] Got NABU_MSG_RN_FILE_OPEN.
DEBUG: rn_recv_filename: [/dev/ttyUSB0] name length: 30
INFO: stext_file_open: [/dev/ttyUSB0] Opening 'http://cloud.nabu.ca/cpm/C.dsk'
DEBUG: stext_file_open: [/dev/ttyUSB0] Need R/W shadow buffer for 'http://cloud.nabu.ca/cpm/C.dsk'
DEBUG: stext_file_open: [/dev/ttyUSB0] Need seekable shadow buffer for 'http://cloud.nabu.ca/cpm/C.dsk'
DEBUG: fileio_load_file: Size of http://cloud.nabu.ca/cpm/C.dsk is 8388608 bytes.

Add flag to store retronet files into storage

The current setup for handling retronet files while works introduces problems with some of the cloud features within retronet.

While running cloud cp/m via the homebrew list the read/write C: disk never will be stored on the computer and is destroyed as it is only in memory. Currently the only workaround is to store c.dsk as C.DSK in the storage location defined on the connection. As you had suggested a good workaround is to include a variable in the config to flag files to be stored persistently:

"PersistentCache": "*.dsk"
"PersistentCache": "c.dsk"

File selection in nabuctl sometimes doesn't work

E.g.

nabuctl> con 2 file 1
No files available.
nabuctl> con 2 file 1
No files available.
nabuctl> list con
1 - Listener [9]  IPv4-5816
2 - TCP      [9]  10.0.0.122
nabuctl> con 2 file 1
10.0.0.122: Selecting file 'CPM22.nabu'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.