top of page
diacathetesa

Serial8250 Too Much Work For Irq 3: Understanding and Troubleshooting the Issue



The entire SOC is emulated on a ZeBu-UF 0.5 and interacts with the outside world through two transactors. A UART transactor displays the console of the emulated SOC in a window on the host workstation. A JTAG transactor connects to the Tensilica software tool chain (Xplorer or xt-gdb for software debugging). Using transactors for all interfaces guarantees that the emulation is completely accurate and in-sync with a real-world scenario, even if hardware breakpoints and single-stepping clocks are used for hardware debugging. A key benefit of using transactors is that each emulation run can be reproduced identically, making it much easier to isolate and reproduce bugs. This can be a major time-saver when chasing a bug that tends to move when you try to isolate it.


To make things simpler, we take advantage of the System.map file generated when compiling the Linux kernel (or any C program for that matter) to obtain the mapping between the driver function name (serial8250_interrupt) and its hardware address:




Serial8250 Too Much Work For Irq 3



Why was the Linux boot able to go that far, and then hang close to the end, if the UART didn't work properly? It turns out that Linux uses two different UART drivers, one (called serial8250_early) which prints characters during the early part of the boot without using interrupts, considered safer. The second one is the "real" UART driver but is only activated once the kernel has finished initialization. If we had stopped hardware testing before completing the Linux boot, relying only on the early driver version, we would not have found that problem in time. While it would have been possible to implement a workaround in the software driver after tape-out, it would have seriously impacted the processor load, as we would have had to rely on active polling instead of interrupts.


the Purley based FS6400 with 32 thread seems to be a good choice here, i915 might be possible (4.4 kernel) to have added but nvidia driver seems to be kernel independent and possible too as alternative, but its meant to be as work horse so transcoding is not important


I was unaware of this issue for quite a long time, I guess because I was mostly working with RHEL clones (CentOS, OEL). I thought that it was a distribution/vendor thing, but apparently even RHEL had this setting disabled in its RHEL7 kernels and Oracle had it disabled in its 4.14 kernel (used with RHEL7), but enabled in 5.4.x. So, you have to check yourself!


I am on Redhat 5.0 RHEL and Suse 10.2. I have build 77234 and tools at the latest version. I have tried a fresh install of both Redhat and Suse 32 and 64 bit, and then I followed the instructions to install the vmtools in Linux, doing /etc/init.d/network stop, rmmod pcnet32, rmmod vmxnet, /usr/bin/vmware-tools-config.pl, network start (sorry if I can't remember the exact steps) but it doesn't recognize the network card, only the local network private (127.0.0.1).


Serial Programming: Introduction and OSI Network Model-- RS-232 Wiring and Connections-- Typical RS232 Hardware Configuration-- 8250 UART-- DOS-- MAX232 Driver/Receiver Family-- TAPI Communications In Windows-- Linux and Unix-- Java-- Hayes-compatible Modems and AT Commands-- Universal Serial Bus (USB)-- Forming Data Packets-- Error Correction Methods-- Two Way Communication-- Packet Recovery Methods-- Serial Data Networks-- Practical Application Development-- IP Over Serial Connections


Finally we are moving away from wires and voltages and hard-core electrical engineering applications, although we still need to know quite a bit regarding computer chip architectures at this level. While the primary focus of this section will concentrate on the 8250 UART, there are really three computer chips that we will be working with here:


Keep in mind that these are chip families, not simply the chip part number itself. Computer designs have evolved quite a bit over the years, and often all three chips are put onto the same piece of silicon because they are tied together so much, and to reduce overall costs of the equipment. So when I say 8086, I also mean the successor chips including the 80286, 80386, Pentium, and compatible chips made by manufacturers other than Intel. There are some subtle differences and things you need to worry about for serial data communication between the different chips other than the 8086, but in many cases you could in theory write software for the original IBM PC doing serial communication and it should run just fine on a modern computer you just bought that is running the latest version of Linux or Windows XP.


Modern operating systems handle most of the details that we will be covering here through low-level drivers, so this should be more of a quick understanding for how this works rather than something you might implement yourself, unless you are writing your own operating system. For people who are designing small embedded computer devices, it does become quite a bit more important to understand the 8250 at this level.


Just like the 8086, the 8250 has evolved quite a bit as well, e.g. into the 16550 UART. Further down I will go into how to detect many of the different UART chips on PCs, and some quirks or changes that affect each one. The differences really aren't as significant as the changes to CPU architecture, and the primary reason for updating the UART chip was to make it work with the considerably faster CPUs that are around right now. The 8250 itself simply can't keep up with a Pentium chip.


Incidentally, this is very similar to how conventional RAM works, and some CPU designs mimic this whole process straight in RAM, reserving a block of memory for I/O control. This has some problems, including the fact that it chews up a portion of potential memory that could be used for software instead. It ends up that with the IBM PC and later PC systems, both Memory-mapped I/O (MMIO) and Port-mapped I/O (PMIO) are used extensively, so it really gets complicated. For serial communication, however, we are going to stick with the port I/O method, as that is how the 8250 chip works.


Warning!! And this really is a warning. By randomly accessing I/O ports in your computer without really knowing what it is connected to can really mess up your computer. At the minimum, it will crash the operating system and cause the computer to not work. Writing to some I/O ports can permanently change the internal configuration of your computer, making a trip to the repair shop necessary just to undo the damage you've done through software. Worse yet, in some cases it can cause actual damage to the computer. This means that some chips inside the computer will no longer work and those components would have to be replaced in order for the computer to work again. Damaged chips are an indication of lousy engineering on the part of the computer, but unfortunately it does happen and you should be aware of it.


Also, while the 8086 CPU was able to address 65536 different I/O ports, in actual practice it didn't. The chip designers at Intel got cheap and only had address lines for 10 bits, which has implications for software designers having to work with legacy systems. This also meant that I/O port address $1E8 and $19E8 (and others... this is just an example) would resolve to the same I/O port for those early PCs. The Pentium CPUs don't have this limitation, but software written for some of that early hardware sometimes wrote to I/O port addresses that were "aliased" because those upper bits were ignored. There are other legacy issues that show up, but fortunately for the 8250 chip and serial communications in general this isn't a concern, unless you happen to have a serial driver that "took advantage" of this aliasing situation. This issue would generally only show up when you are using more than the typical 2 or 4 serial COM ports on a PC.


How this is best done depends largely on your operating system. For a simple operating system like MS-DOS, it actually encourages you to directly write these interrupt handlers, particularly when you are working with external peripherals. Other operating systems like Linux or MS-Windows use the approach of having a "driver" that hooks into these interrupt handlers or service routines, and then the application software deals with the drivers rather than dealing directly with the equipment. How a program actually does this is very dependent on the specific operating system you would be using. If you are instead trying to write your own operating system, you would have to write these interrupt handlers directly, and establish the protocol on how you access these handlers to send and retrieve data.


Keep in mind that this is the "typical" Port I/O address for most PC-compatible type computer systems, and can vary depending on what the manufacturer is trying to accomplish. Generally you don't have to worry about incompatibility at this level, but when we get to Port I/O addresses for the serial ports this will become a much larger issue.


I'm going to spend a little time here to explain the meaning of the word register. When you are working with equipment at this level, the electrical engineers who designed the equipment refer to registers that change the configuration of the equipment. This can happen at several levels of abstraction, so I want to clear up some of the confusion.


Before we leave the subject of the 8259 PIC, I'd like to cover the concept of device masking. Each one of the devices that are attached to the PIC can be "turned on" or "turned off" from the viewpoint of how they can interrupt the CPU through the PIC chip. Usually as an application developer all we really care about is if the device is turned on, although if you are trying to isolate performance issues you might turn off some other devices. Keep in mind that if you turn a device "off", the interrupt will not work until it is turned back on. That can include the keyboard or other critical devices you may need to operate your computer.


which will simply enable everything. This may not be a good thing to do, but will have to be something for you to experiment with depending on what you are working with. Try not to take short cuts like this as not only is it a sign of a lazy programmer, but it can have side effects that your computer may behave different than you intended. If you are working with the computer at this level, the goal is to change as little as possible so you don't cause damage to any other software you are using. 2ff7e9595c


0 views0 comments

Recent Posts

See All

Baixe o 888starz apk

888starz Download APK: Como apostar e jogar jogos de cassino com moeda virtual Se você está procurando uma maneira nova e excitante de...

Comments


bottom of page