Computer Science course (Hardware/Software interaction)

Click For Summary

Discussion Overview

The discussion centers on identifying computer science courses that cover the interaction between hardware and software. Participants explore various perspectives on this topic, including the physical and architectural aspects of computing, as well as the programming languages involved in hardware-software interfacing.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant inquires about courses that address the connection between hardware and software, noting difficulty in finding comprehensive options.
  • Another participant suggests that the topic can be approached from multiple perspectives, including physics and architecture, detailing how computers operate at a fundamental level.
  • Discussion includes the role of transistors and logical gates in building hardware, as well as the importance of understanding instruction sets and memory models in computer architecture.
  • Participants mention specific instructions (IN and OUT) and interrupts as key mechanisms for hardware-software interaction, with examples from historical programming practices.
  • One participant proposes that a program focusing on assembly language would be beneficial for understanding hardware-software interfacing.
  • Another participant notes that their school emphasizes architecture and operating systems for this topic, indicating variability in course content across institutions.

Areas of Agreement / Disagreement

Participants express differing views on the specific courses and programming languages that best cover hardware-software interaction, indicating that there is no consensus on a singular approach or curriculum.

Contextual Notes

Participants highlight the complexity of the subject, mentioning various layers of understanding, such as physical properties, architectural design, and programming practices, without resolving the nuances or dependencies among these areas.

Who May Find This Useful

Individuals interested in computer science education, particularly those looking to understand the integration of hardware and software, may find this discussion relevant.

DrummingAtom
Messages
657
Reaction score
2
What is a CS course that covers how software and hardware are connected? This probably seems simple to most but I have no clue as to how this interaction works. A lot of the courses I've looked up seem to be either hardware or software only. Also, is there a name for this area of CS so I can look up stuff on my own?

Thanks. :blushing:
 
Physics news on Phys.org
There are a couple of courses that deal with this, but it depends on the perspective you want. I'll list a few perspectives that you could use on this subject:

* Physics

The first layer is the physical layer and deals with the physics of computers, so basically how computers do what they do.

Typically if you're an engineer you will be taught that you can build things that make discrete decisions (ie set a gate to have a low or a high voltage based on its inputs) by using using transistors in certain configurations.

If you want to know about the properties of transistors then you'll be getting into more of the physics of semiconductors, but if we accept these devices (logical gates) as building blocks then we can see how logical operations are formed.

Once you build one type of gate (like say a NAND gate) then you use some boolean math to construct the other gates. Once this is done you go into boolean math again to build all of the arithmetic instructions for binary numbers and build a whole heap of hardware that does specific things (like add two numbers, multiply numbers, XOR numbers, hold a number in memory etc).

2) Architecture

So once you know how the gates work you look at how computers are structured and for this you'll look at the architecture, the instruction set, the memory model, the execution model and so on.

Typically each different computer platform will have its own operational codes and instruction set to do execute programs. I'll briefly talk about the x86 instruction set found on common PC's for 32-bit environments (could easily be extended to 64-bit or another arbitrary register size)

So basically in the x86 environment we have a) registers b) a flat memory space c) arithmetic operations (add,sub,mul,div,mod) d) logical operations (AND,OR,XOR) as well as SHIFTS,ROTATES d) Stack operations e) Flag operations f) CALL operations and RETURN operations e) NonConditional and Conditional JUMP operations e) Interrupt specific operations f) Hardware port operations g) Memory operations h) and Register operations. These are the main ones.

I'm going to simplify this as to focus on the main details.

Basically what happens is that you have a few main types of memory (I'm going to ignore models of protected memory, OS specific memory and assume that the system and its applications have access to everything)

a) Stack memory
b) Heap memory
c) Register memory

What happens is that the registers contain the information that each instruction deals with. So basically we put the specific values that we require (either from memory or another register) into the appropriate registers and then call an appropriate instruction that uses these registers and their values. That's the execution cycle in a nutshell.

With regards to how hardware and software interact, there are two main sorts of instructions that allow them to do so:

1) IN and OUT instructions
2) Interrupts

For IN and OUT basically you have a port (65536 for old x86 but could be more for current specs not sure) and you either check the ports state (IN) or write to it (OUT).

Back in the QBASIC days I wrote a few drivers (keyboard driver and SVGA driver) for old applications. One example is setting the palette for a 256 color VGA screen mode.

So what you would do to tell the hardware that I'm changing a palette value is to OUT 0x3C7, x where x is the index of the color and then you would do OUT 0x3C9,a ; OUT 0x3C9,b; OUT 0x3C9, c where (a,b,c) is the RGB colour for that palette.

If you want to directly communicate with hardware one way is the direct communication mechanism provided with IN and OUT.

The second method is an interrupt.

An interrupt can be either a software interrupt or a hardware interrupt. Software interrupts are generated by software and hardware interrupts are generated by hardware.

So let's say you want to know when the keyboard is communicating with the computer.

The first thing you do is find out given an architecture book and a standards book what interrupts are generated by what pieces of hardware.
Once you do this you write your bit of code to handle that device based on the parameters that are in memory.

So yeah in a nutshell If what I think you're looking for is correct then you can check out these kind of things. Also look into device driver SDK's for common platforms (Windows,Linux,UNIX etc) and you will get a first hand look at what these things look like.
Once you've written the code to handle this (for example keyboard interrupt might simply update an array that holds what key is currently pressed or might be more complex in tracking what keys have been pressed and released or double pressed etc) you then modify the systems interrupt vector by pointing the hardware interrupt to your code.

This is how things happened in the DOS days. Essentially the DOS system provided a library of software interrupts that allowed you to have Disk Access, A Clock, Video Access, MSCDEX (CD extensions on the multiplex interrupt) and so on.

Nowadays you don't get access to these things like you did in the DOS days. Applications don't get access to protected memory that the operating system uses.
 
Last edited:
From what I understand it will be a program that teaches you to work well in assembly language doing hardware and software interfacing.
 
╔(σ_σ)╝ said:
From what I understand it will be a program that teaches you to work well in assembly language doing hardware and software interfacing.
Not always. In my school the courses that hit most on this are architecture (which is mostly VHDL) and Operating Systems (which doesn't have a language/C).
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
2K
  • · Replies 13 ·
Replies
13
Views
5K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 4 ·
Replies
4
Views
8K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K