Serial port number windows

Serial Port Console Redirection Table (SPCR)

This document defines the content of the Serial Port Console Redirection Table. This table is used to indicate whether a serial port or a non-legacy UART interface is available for use with MicrosoftВ® WindowsВ® Emergency Management Services (EMS).

The table provides information about the configuration and use of the serial port or non-legacy UART interface. On a system where the BIOS or system firmware uses the serial port for console input/output, this table should be used to convey information about the settings, to ensure a seamless transition between the firmware console output and Windows EMS output.

This table must be located in system memory with other ACPI tables, and it must be referenced in the ACPI RSDT table.

Patent Notice: Microsoft is making certain patent rights available for implementations of this specification under two options:

Field Byte Length Byte Offset Description
Header
Signature 4 0 ‘SPCR’. Signature for the Serial Port Console Redirection Table.
Length 4 4 Length, in bytes, of the entire Serial Port Console Redirection Table.
Revision 1 8 2
Checksum 1 9 Entire table must sum to zero.
OEMID 6 10 OEM ID.
OEM Table ID 8 16 For the Serial Port Console Redirection Table, the table ID is the manufacturer model ID.
OEM Revision 4 24 OEM revision of Serial Port Console Redirection Table for supplied OEM Table ID.
Creator ID 4 28 Vendor ID of utility that created the table. For the DSDT, RSDT, SSDT, and PSDT tables, this is the ID for the ASL Compiler.
Creator Revision 4 32 Revision of utility that created the table. For the DSDT, RSDT, SSDT, and PSDT tables, this is the revision for the ASL Compiler.
Interface Type 1 36 Indicates the type of the register interface:
  • 0 = full 16550 interface
  • 1 = full 16450 interface (must also accept writing to the 16550 FCR register)
  • 2-255 = reserved

See the Serial Port Subtypes in Table 3 of the DBG2 Specification

Reserved 3 37 Must be 0. Base Address 12 40

The base address of the Serial Port register set described using the ACPI Generic Address Structure.

0 = console redirection disabled

Note:

COM1 (0x3F8) would be:

  • Integer Form: 0x 01 08 00 00 00000000000003F8
  • Viewed in Memory: 0x01080000F803000000000000

COM2 (0x2F8) would be:

  • Integer Form: 0x 01 08 00 00 00000000000002F8
  • Viewed in Memory: 0x01080000F802000000000000
Interrupt Type 1 52 Interrupt type(s) used by the UART:
  • Bit[0]: PC-AT-compatible dual-8259 IRQ interrupt
  • Bit[1]: I/O APIC interrupt (Global System Interrupt)
  • Bit[2]: I/O SAPIC interrupt (Global System Interrupt)
  • Bit[3]: ARMH GIC interrupt (Global System Interrupt)
  • Bit[4:7]: Reserved (Must be set to 0)

Where

  • 0 = Not supported
  • 1 = Supported

Platforms with both a dual-8259 and an I/O APIC or I/O SAPIC must set the IRQ bit (Bit[0]) and the corresponding Global System Interrupt bit (e.g. a system that supported 8259 and SAPIC would be 5). IRQ 1 53 The PC-AT-compatible IRQ used by the UART:

  • 2-7, 9-12, 14-15 = Valid IRQs respectively
  • 0-1, 8, 13, 16-255 = Reserved

Valid only if Bit[0] of the Interrupt Type field is set. Global System Interrupt 4 54 The Global System Interrupt (GSIV) used by the UART.

Not valid if Bit[0] is the only bit set in the Interrupt Type field.

Baud Rate 1 58 The baud rate the BIOS used for redirection:
  • 0 = As is, operating system relies on the current configuration of serial port until the full featured driver will be initialized.
  • 3 = 9600
  • 4 = 19200
  • 6 = 57600
  • 7 = 115200
  • 1-2, 5, 8 — 255 = Reserved
Parity 1 59
  • 0 = No Parity
  • 1-255 = Reserved
Stop Bits 1 60
  • 1 = 1 Stop bit
  • 0, 2-255 = Reserved
Flow Control 1 61
  • Bit[0] = DCD required for transmit
  • Bit[1] = RTS/CTS hardware flow control
  • Bit[2] = XON/XOFF software control
  • Bit[3:7] = reserved, must be zero
Terminal Type 1 62 The terminal protocol the BIOS was using for console redirection:
  • 0 = VT100
  • 1 = Extended VT100 (VT100+)
  • 2 = VT-UTF8
  • 3 = ANSI
  • 4-255 = Reserved
Language 1 63 Language which the BIOS was redirecting. Must be 0. PCI Device ID 2 64 Designates the Device ID of a PCI device that contains a UART to be used as a headless port.

Must be 0xFFFF if it is not a PCI device.

PCI Vendor ID 2 66 Designates the Vendor ID of a PCI device that contains a UART to be used as a headless port.

Must be 0xFFFF if it is not a PCI device.

PCI Bus Number 1 68 PCI Bus Number if table describes a PCI device.

Must be 0x00 if it is not a PCI device.

PCI Device Number 1 69 PCI Device Number if table describes a PCI device.

Must be 0x00 if it is not a PCI device.

PCI Function Number 1 70 PCI Function Number if table describes a PCI device.

Must be 0x00 if it is not a PCI device.

PCI Flags 4 71 PCI Compatibility flags bitmask. Should be zero by default.
  • Bit[0]: Operating System should NOT suppress PNP device enumeration or disable power management for this device. Must be 0 if it is not a PCI device.
  • Bit21: Reserved, must be zero.
PCI Segment 1 75 PCI segment number.

For systems with fewer than 255 PCI buses, this number must be 0.

Serial Port Класс

Определение

Представляет ресурс последовательного порта. Represents a serial port resource.

Примеры

В следующем примере кода показано использование SerialPort класса, чтобы два пользователя могли общаться с двух отдельных компьютеров, Соединенных нуль-модемным кабелем. The following code example demonstrates the use of the SerialPort class to allow two users to chat from two separate computers connected by a null modem cable. В этом примере пользователям предлагается ввести параметры порта и имя пользователя перед разговором. In this example, the users are prompted for the port settings and a username before chatting. Для обеспечения полной функциональности этого примера оба компьютера должны выполнять программу. Both computers must be executing the program to achieve full functionality of this example.

Комментарии

Используйте этот класс для управления файловым ресурсом последовательного порта. Use this class to control a serial port file resource. Этот класс обеспечивает синхронный и управляемый событиями ввод-вывод, доступ к состояниям ПИН-кода и прерываний, а также доступ к свойствам последовательного драйвера. This class provides synchronous and event-driven I/O, access to pin and break states, and access to serial driver properties. Кроме того, функциональные возможности этого класса могут быть заключены во внутренний Stream объект, доступны через BaseStream свойство и переданы в классы, которые переносятся в оболочку или используют потоки. Additionally, the functionality of this class can be wrapped in an internal Stream object, accessible through the BaseStream property, and passed to classes that wrap or use streams.

SerialPortКласс поддерживает следующие кодировки: ASCIIEncoding , UTF8Encoding , UnicodeEncoding , UTF32Encoding и любую кодировку, определенную в mscorlib.dll, где кодовая страница меньше 50000 или кодовая страница 54936. The SerialPort class supports the following encodings: ASCIIEncoding, UTF8Encoding, UnicodeEncoding, UTF32Encoding, and any encoding defined in mscorlib.dll where the code page is less than 50000 or the code page is 54936. Можно использовать альтернативные кодировки, но необходимо использовать ReadByte Write метод или и выполнить кодирование самостоятельно. You can use alternate encodings, but you must use the ReadByte or Write method and perform the encoding yourself.

GetPortNamesМетод используется для получения допустимых портов для текущего компьютера. You use the GetPortNames method to retrieve the valid ports for the current computer.

Если SerialPort объект блокируется во время операции чтения, не прерывайте поток. If a SerialPort object becomes blocked during a read operation, do not abort the thread. Вместо этого закройте базовый поток или удалите SerialPort объект. Instead, either close the base stream or dispose of the SerialPort object.

Конструкторы

Инициализирует новый экземпляр класса SerialPort. Initializes a new instance of the SerialPort class.

Инициализирует новый экземпляр класса SerialPort, используя указанный объект IContainer. Initializes a new instance of the SerialPort class using the specified IContainer object.

Инициализирует новый экземпляр класса SerialPort, используя указанное имя порта. Initializes a new instance of the SerialPort class using the specified port name.

Инициализирует новый экземпляр класса SerialPort, используя указанное имя порта и скорость передачи в бодах. Initializes a new instance of the SerialPort class using the specified port name and baud rate.

Инициализирует новый экземпляр класса SerialPort, используя указанное имя порта, скорость передачи в бодах и бит четности. Initializes a new instance of the SerialPort class using the specified port name, baud rate, and parity bit.

Инициализирует новый экземпляр класса SerialPort, используя указанное имя порта, скорость передачи в бодах, бит четности и биты данных. Initializes a new instance of the SerialPort class using the specified port name, baud rate, parity bit, and data bits.

Инициализирует новый экземпляр класса SerialPort, используя указанное имя порта, скорость передачи в бодах, бит четности, биты данных и стоп-бит. Initializes a new instance of the SerialPort class using the specified port name, baud rate, parity bit, data bits, and stop bit.

Указывает, что отсчет времени ожидания не производится. Indicates that no time-out should occur.

Свойства

Возвращает базовый объект Stream для объекта SerialPort. Gets the underlying Stream object for a SerialPort object.

Возвращает или задает скорость передачи для последовательного порта (в бодах). Gets or sets the serial baud rate.

Получает или задает состояние сигнала разрыва. Gets or sets the break signal state.

Возвращает число байтов данных, находящихся в буфере приема. Gets the number of bytes of data in the receive buffer.

Получает число байтов данных, находящихся в буфере отправки. Gets the number of bytes of data in the send buffer.

Возвращает значение, показывающее, может ли компонент вызывать событие. Gets a value indicating whether the component can raise an event.

(Унаследовано от Component) CDHolding

Получает состояние линии обнаружения несущей для порта. Gets the state of the Carrier Detect line for the port.

Возвращает объект IContainer, который содержит коллекцию Component. Gets the IContainer that contains the Component.

(Унаследовано от Component) CtsHolding

Возвращает состояние линии готовности к приему. Gets the state of the Clear-to-Send line.

Возвращает или задает стандартное число битов данных в байте. Gets or sets the standard length of data bits per byte.

Возвращает значение, указывающее, находится ли данный компонент Component в режиме конструктора в настоящее время. Gets a value that indicates whether the Component is currently in design mode.

(Унаследовано от Component) DiscardNull

Возвращает или задает значение, показывающее, игнорируются ли пустые байты (NULL), передаваемые между портом и буфером приема. Gets or sets a value indicating whether null bytes are ignored when transmitted between the port and the receive buffer.

Получает или задает состояние сигнала готовности данных (DSR). Gets the state of the Data Set Ready (DSR) signal.

Получает или задает значение, включающее поддержку сигнала готовности терминала (DTR) в сеансе последовательной связи. Gets or sets a value that enables the Data Terminal Ready (DTR) signal during serial communication.

Получает или задает кодировку байтов для преобразования текста до и после передачи. Gets or sets the byte encoding for pre- and post-transmission conversion of text.

Возвращает список обработчиков событий, которые прикреплены к этому объекту Component. Gets the list of event handlers that are attached to this Component.

(Унаследовано от Component) Handshake

Возвращает или задает протокол установления связи для передачи данных через последовательный порт с использованием значения Handshake. Gets or sets the handshaking protocol for serial port transmission of data using a value from Handshake.

Возвращает значение, указывающее открытое или закрытое состояние объекта SerialPort. Gets a value indicating the open or closed status of the SerialPort object.

Возвращает или задает значение, используемое для интерпретации окончания вызова методов ReadLine() и WriteLine(String). Gets or sets the value used to interpret the end of a call to the ReadLine() and WriteLine(String) methods.

Возвращает или задает протокол контроля четности. Gets or sets the parity-checking protocol.

Возвращает или задает байт, которым заменяются недопустимые байты потока данных при обнаружении ошибок четности. Gets or sets the byte that replaces invalid bytes in a data stream when a parity error occurs.

Получает или задает последовательный порт, в частности, любой из доступных портов COM. Gets or sets the port for communications, including but not limited to all available COM ports.

Возвращает или задает размер входного буфера SerialPort. Gets or sets the size of the SerialPort input buffer.

Получает или задает срок ожидания в миллисекундах для завершения операции чтения. Gets or sets the number of milliseconds before a time-out occurs when a read operation does not finish.

Возвращает или задает число байтов во внутреннем входном буфере до возникновения события DataReceived. Gets or sets the number of bytes in the internal input buffer before a DataReceived event occurs.

Возвращает или задает значение, показывающее, включен ли сигнал запроса передачи (RTS) в сеансе последовательной связи. Gets or sets a value indicating whether the Request to Send (RTS) signal is enabled during serial communication.

Получает или задает ISite объекта Component. Gets or sets the ISite of the Component.

(Унаследовано от Component) StopBits

Получает или задает стандартное число стоповых битов в байте. Gets or sets the standard number of stopbits per byte.

Возвращает или задает размер выходного буфера последовательного порта. Gets or sets the size of the serial port output buffer.

Получает или задает срок ожидания в миллисекундах для завершения операции записи. Gets or sets the number of milliseconds before a time-out occurs when a write operation does not finish.

Методы

Закрывает соединение порта, присваивает свойству IsOpen значение false и уничтожает внутренний объект Stream. Closes the port connection, sets the IsOpen property to false , and disposes of the internal Stream object.

Создает объект, который содержит всю необходимую информацию для создания прокси-сервера, используемого для взаимодействия с удаленным объектом. Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Унаследовано от MarshalByRefObject) DiscardInBuffer()

Удаляет данные из буфера приема последовательного драйвера. Discards data from the serial driver’s receive buffer.

Удаляет данные из буфера передачи последовательного драйвера. Discards data from the serial driver’s transmit buffer.

Освобождает все ресурсы, занятые модулем Component. Releases all resources used by the Component.

(Унаследовано от Component) Dispose(Boolean)

Освобождает неуправляемые ресурсы, используемые объектом SerialPort, а при необходимости освобождает также управляемые ресурсы. Releases the unmanaged resources used by the SerialPort and optionally releases the managed resources.

Определяет, равен ли указанный объект текущему объекту. Determines whether the specified object is equal to the current object.

(Унаследовано от Object) GetHashCode()

Служит хэш-функцией по умолчанию. Serves as the default hash function.

(Унаследовано от Object) GetLifetimeService()

Извлекает объект обслуживания во время существования, который управляет политикой времени существования данного экземпляра. Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Унаследовано от MarshalByRefObject) GetPortNames()

Получает массив имен последовательных портов для текущего компьютера. Gets an array of serial port names for the current computer.

Возвращает объект, представляющий службу, предоставляемую классом Component или классом Container. Returns an object that represents a service provided by the Component or by its Container.

(Унаследовано от Component) GetType()

Возвращает объект Type для текущего экземпляра. Gets the Type of the current instance.

(Унаследовано от Object) InitializeLifetimeService()

Получает объект службы времени существования для управления политикой времени существования для этого экземпляра. Obtains a lifetime service object to control the lifetime policy for this instance.

(Унаследовано от MarshalByRefObject) MemberwiseClone()

Создает неполную копию текущего объекта Object. Creates a shallow copy of the current Object.

(Унаследовано от Object) MemberwiseClone(Boolean)

Создает неполную копию текущего объекта MarshalByRefObject. Creates a shallow copy of the current MarshalByRefObject object.

(Унаследовано от MarshalByRefObject) Open()

Открывает новое соединение последовательного порта. Opens a new serial port connection.

Считывает из входного буфера SerialPort определенное число байтов и записывает их в байтовый массив, начиная с указанной позиции. Reads a number of bytes from the SerialPort input buffer and writes those bytes into a byte array at the specified offset.

Считывает из входного буфера SerialPort определенное число символов и записывает их в символьный массив, начиная с указанной позиции. Reads a number of characters from the SerialPort input buffer and writes them into an array of characters at a given offset.

Считывает из входного буфера SerialPort один байт в синхронном режиме. Synchronously reads one byte from the SerialPort input buffer.

Считывает из входного буфера SerialPort один символ в синхронном режиме. Synchronously reads one character from the SerialPort input buffer.

Считывает все непосредственно доступные байты в соответствии с кодировкой из потока и из входного буфера объекта SerialPort. Reads all immediately available bytes, based on the encoding, in both the stream and the input buffer of the SerialPort object.

Считывает данные из входного буфера до значения NewLine. Reads up to the NewLine value in the input buffer.

Считывает из входного буфера строку до указанного значения value . Reads a string up to the specified value in the input buffer.

Возвращает объект String, содержащий имя Component, если оно есть. Returns a String containing the name of the Component, if any. Этот метод не следует переопределять. This method should not be overridden.

(Унаследовано от Component) Write(Byte[], Int32, Int32)

Записывает указанное число байтов в последовательный порт, используя данные из буфера. Writes a specified number of bytes to the serial port using data from a buffer.

Записывает указанное число символов в последовательный порт, используя данные из буфера. Writes a specified number of characters to the serial port using data from a buffer.

Записывает указанную строку в последовательный порт. Writes the specified string to the serial port.

Записывает указанную строку и значение NewLine в выходной буфер. Writes the specified string and the NewLine value to the output buffer.

События

Указывает, что данные были получены через порт, представленный объектом SerialPort. Indicates that data has been received through a port represented by the SerialPort object.

Возникает при удалении компонента путем вызова метода Dispose(). Occurs when the component is disposed by a call to the Dispose() method.

(Унаследовано от Component) ErrorReceived

Указывает, что произошла ошибка с портом, представленным объектом SerialPort. Indicates that an error has occurred with a port represented by a SerialPort object.

Указывает, что для порта, представленного объектом SerialPort, возникло событие сигнала, не связанного с данными. Indicates that a non-data signal event has occurred on the port represented by the SerialPort object.

Читайте также:  Сколько операционных систем windows выпустила microsoft
Оцените статью