Opened 9 years ago

Closed 5 years ago

Last modified 5 years ago

#5754 closed enhancement (fixed)

[pc_serial] [PATCH] Fix build for Haiku

Reported by: andreasf Owned by: mmu_man
Priority: normal Milestone: R1
Component: Drivers Version: R1/Development
Keywords: Cc:
Blocked By: #35 Blocking:
Has a Patch: no Platform: x86

Description

Here's an initial stab at making the pc_serial driver compile for Haiku target:

  • Clean up the BONE/R5/Haiku tty_module_info mess a little.
  • The functions either need to be static in both header and source, or not at all.
  • Haiku does not seem to have a ddbackground function.

With these changes, I can successfully do the following in my UserBuildConfig:

AddDriversToHaikuImage ports : pc_serial ;

It does not yet work for my card though.

Attachments (1)

pc_serial.diff (2.8 KB ) - added by andreasf 9 years ago.
proposed patch

Download all attachments as: .zip

Change History (11)

by andreasf, 9 years ago

Attachment: pc_serial.diff added

proposed patch

comment:1 by bonefish, 9 years ago

Cc: mmu_man removed
Component: Drivers/TTYDrivers
Owner: changed from bonefish to mmu_man
Status: newassigned

comment:2 by mmu_man, 9 years ago

Of course it does not work because there is no tty module yet. The header only describes a BeOS-compatible module but it will probably not be done this way.

in reply to:  2 comment:3 by andreasf, 9 years ago

I don't fully understand. Is something apart from the static issue wrong with my patch? What do you mean with "tty module"? There appears to be a tty add-on that gets installed by default.

I'm looking for a short-term way of testing my serial-related patches for Mono, whether with my built-in serial port (that the kernel uses by default) or with a PCI card (OxfordSemi 950a) or with a USB adapter (067b:2303). None are listed as /dev/ports/serialX at this time, so any pointers how to improve things would be appreciated.

comment:4 by mmu_man, 9 years ago

The tty binary is the tty driver, which publishes /dev/tt/*, not the tty manager. As such we do not have any in Haiku yet, so this only fixes the build but doesn't make it usable. Though it should be possible to use the BeOS tty manager for testing. But the current API is not the one which will be used later on.

comment:5 by mmu_man, 9 years ago

Fixed differently as hrev36515.

comment:6 by mmlr, 9 years ago

I'm currently working on the tty module. It will have a different API than the old ones though, pretty much like the internal API the tty driver currently uses. So the drivers will need to be ported to it. I've already done that for usb_serial, however it is not yet complete and does not yet fully work, so I won't commit it right now.

in reply to:  4 comment:7 by andreasf, 9 years ago

I've tried copying the R5.0.3 /beos/system/add-ons/kernel/bus_managers/tty to hrev36576 /system/add-ons/kernel/bus_managers/tty.

There's still nothing under /dev/ports/ and no mention of pc_serial in syslog.

Is my way of adding them to the image wrong? Anything else I need to copy or symlink?

comment:8 by andreasf, 8 years ago

Blocked By: 35 added

comment:9 by pulkomandy, 5 years ago

Resolution: fixed
Status: assignedclosed

The driver is working now. However to get it to use your serial port you must make sure the kernel does not use it for serial debug. Disabling serial debug is not enough, you must actually change the serial port to an unused one in the kernel settings file.

comment:10 by korli, 5 years ago

This reminds me we don't have man like pages for drivers, where to put such useful information...

Note: See TracTickets for help on using tickets.