Opened 4 years ago

Last modified 3 years ago

#12631 assigned enhancement

UDP serial debug interface

Reported by: kallisti5 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/Kernel Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All


This ticket logs some ideas PulkoMandy and landonf had in irc about solutions to the "no serial on a lot of new devices" issue.

Debugging Haiku on new hardware can be troublesome, especially if no serial interface is available (common on most modern hardware)

Other operating systems like OS X and windows offer serial debugging via UDP packets. Debugging over UDP would greatly assist users in troubleshooting KDL's, boot issues, or Debugger on system kits.

15:22 < landonf> Ethernet debugging for FreeBSD is actually on my TODO list, so if that coincides with FreeBSD compat driver support on the Haiku side ...                                                          |
15:22 <@kallisti5> landonf: any specs out there for serial over ethernet?                                                                                                                                           |
15:22 <@kallisti5> something next to tcp                                                                                                                                                                            |
15:23 <@PulkoMandy> just use UDP frames, broadcast on some random port                                                                                                                                              |
15:23 < landonf> Most implementations just send ethernet frames                                                                                                                                                     |
15:23 <@PulkoMandy> or I've seen it done with ARP or ICMP headers or whatever                                                                                                                                       |
15:23 <@PulkoMandy> just raw ethernet works as well with appropriate software on the other side of the link anyway                                                                                                  |
15:23 <@kallisti5>                                                                                                               |
15:23 < bslsk05> ​ Serial data over UDP Sockets in Python - Stack Overflow                                                                                                                         |
15:24 <@PulkoMandy> so… python in the kernel? :D                                                                                                                                                                    |
15:24 <@kallisti5>                                   |
15:24 < bslsk05> ​ Setting up a UDP based network serial port on a Linksys WRT54GS router. | Andrew Hazelden's Blog                                                                           |
15:27 < landonf>                                                                                                                     |
15:27 < landonf> This is the kernel-side implementation of the protocol OS X uses                                                                                                                                   |
15:28 <@kallisti5> I think just getting kdl into that would be a huge jump                                                                                                                                          |
15:28 <@kallisti5> you can extract syslogs from there                                                                                                                                                               |
15:28 <@PulkoMandy> well, if you get the basic frame send/receive working you could even plug our gdb stub to it                                                                                                    |
15:30 <@kallisti5> what about ethernet drivers after kdl?                                                                                                                                                           |
15:30 <@kallisti5> don't they lock up?                                                                                                                                                                              |
15:30 < landonf> kdp_udp.c provides the UDP implementation of the Kernel Debugging Protocol (KDP). The network driver is polled for packets, on top of which is implemented a *very* minimal ARP/IP/UDP stack.      |
15:31 < landonf> This is what the driver interface looks like:                                              |
15:31 < landonf> kallisti5: You have to provide direct/pollled access to read/write of ethernet frames                                                                                                              |
15:32 < landonf> So ethernet drivers have to be extended.                                                                                                                                                           |
15:32 < landonf> And it's not a great solution for debugging the ethernet driver you're using for the debugging interface :)             

Change History (1)

comment:1 by axeld, 3 years ago

Owner: changed from axeld to nobody
Status: newassigned
Note: See TracTickets for help on using tickets.