- added empty stubs for serial_raw. To try it out, define USE_RAW_SERIAL
in config.h and add serial_raw.o to the makefile in the iodev directory.
This commit is contained in:
parent
3532885cf2
commit
1ae66aeeb6
@ -229,6 +229,8 @@
|
||||
#define BX_SOUND_OUTPUT_C bx_sound_output_c
|
||||
#endif
|
||||
|
||||
#define USE_RAW_SERIAL 0
|
||||
|
||||
#define BX_USE_SPECIFIED_TIME0 0
|
||||
|
||||
// This enables writing to port 0xe9 and the output
|
||||
|
@ -144,6 +144,9 @@ public:
|
||||
bx_serial_c(void);
|
||||
~bx_serial_c(void);
|
||||
BX_SER_SMF void init(bx_devices_c *);
|
||||
#if USE_RAW_SERIAL
|
||||
serial_raw* raw;
|
||||
#endif // USE_RAW_SERIAL
|
||||
|
||||
private:
|
||||
bx_serial_t s[BX_SERIAL_MAXDEV];
|
||||
@ -162,9 +165,6 @@ private:
|
||||
Bit32u read(Bit32u address, unsigned io_len);
|
||||
void write(Bit32u address, Bit32u value, unsigned io_len);
|
||||
#endif
|
||||
#if USE_RAW_SERIAL
|
||||
serial_raw* raw;
|
||||
#endif // USE_RAW_SERIAL
|
||||
};
|
||||
|
||||
|
||||
|
89
bochs/iodev/serial_raw.cc
Normal file
89
bochs/iodev/serial_raw.cc
Normal file
@ -0,0 +1,89 @@
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
//
|
||||
// MandrakeSoft S.A.
|
||||
// 43, rue d'Aboukir
|
||||
// 75002 Paris - France
|
||||
// http://www.linux-mandrake.com/
|
||||
// http://www.mandrakesoft.com/
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
|
||||
#include "bochs.h"
|
||||
#define LOG_THIS bx_serial.
|
||||
|
||||
serial_raw::serial_raw (char *ttypath, int signal)
|
||||
{
|
||||
setprefix ("[SERR]");
|
||||
settype (SERRLOG);
|
||||
}
|
||||
|
||||
void
|
||||
serial_raw::set_baudrate (int rate)
|
||||
{
|
||||
BX_DEBUG (("set_baudrate %d", rate));
|
||||
}
|
||||
|
||||
void
|
||||
serial_raw::set_data_bits (int val)
|
||||
{
|
||||
BX_DEBUG (("set data bits (%d)", val));
|
||||
}
|
||||
|
||||
void
|
||||
serial_raw::set_stop_bits (int val)
|
||||
{
|
||||
BX_DEBUG (("set stop bits (%d)", val));
|
||||
}
|
||||
|
||||
void
|
||||
serial_raw::set_parity_mode (int x, int y)
|
||||
{
|
||||
BX_DEBUG (("set parity %d %d", x, y));
|
||||
}
|
||||
|
||||
void
|
||||
serial_raw::transmit (int val)
|
||||
{
|
||||
BX_DEBUG (("transmit %d", val));
|
||||
}
|
||||
|
||||
void
|
||||
serial_raw::send_hangup ()
|
||||
{
|
||||
BX_DEBUG (("send_hangup"));
|
||||
}
|
||||
|
||||
int
|
||||
serial_raw::ready_transmit ()
|
||||
{
|
||||
BX_DEBUG (("ready_transmit returning 1"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
serial_raw::ready_receive ()
|
||||
{
|
||||
BX_DEBUG (("ready_receive returning 0"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
serial_raw::receive ()
|
||||
{
|
||||
BX_DEBUG (("receive returning 0"));
|
||||
return (int)'A';
|
||||
}
|
||||
|
19
bochs/iodev/serial_raw.h
Normal file
19
bochs/iodev/serial_raw.h
Normal file
@ -0,0 +1,19 @@
|
||||
#include <linux/serial.h>
|
||||
|
||||
#define P_EVEN 0
|
||||
#define P_ODD 1
|
||||
#define C_BREAK 201
|
||||
|
||||
class serial_raw : public logfunctions {
|
||||
public:
|
||||
serial_raw (char *ttypath, int signal);
|
||||
void set_baudrate (int rate);
|
||||
void set_data_bits (int );
|
||||
void set_stop_bits (int);
|
||||
void set_parity_mode (int, int);
|
||||
void transmit (int byte);
|
||||
void send_hangup ();
|
||||
int ready_transmit ();
|
||||
int ready_receive ();
|
||||
int receive ();
|
||||
};
|
Loading…
Reference in New Issue
Block a user