Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3674066
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:48:35+00:00 2026-05-19T02:48:35+00:00

As I know in order to write device drivers people usually use c++ or

  • 0

As I know in order to write device drivers people usually use c++ or assembly? The choice of assembly is clear for me. But why c++? I guess it is possible to do in java (for example), or in other high level language as well. So why c++ is so common? Is there a specific feature of C++ programming language that is necessary for writing drivers?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:48:36+00:00Added an answer on May 19, 2026 at 2:48 am

    I would say that C is much more commonly used as a language for device drivers (over C++).

    There are a couple of reasons for this:

    1. Most of the major operating systems are written in a combination of C and assembler and provide C language interfaces to the operating system.
    2. Writing a device driver usually involves communicating with a device which involves direct memory manipulation of registers and the like. C and C++ allow you to do this natively.

    Edit – Example of Direct Memory Manipulation:

    Let me make up some fictitious device. Say it has a register, that when you write certain values onto it, makes a light on the device turn on. This register is 32 bits wide. The top 31 bits say how bright to make the light, the lowest bit turns it on and off.

    When you plug the device into the computer, the operating system assigns that register a particular memory location, (let’s say 0x00FF00FF00 on a 32 bit OS). In order to turn the light on, the device driver would do something like this:

    int* lightRegister = 0x00FF00FF00; // You would normally ask the OS for this address, not hardcode it.
    int brightnessValue = 256; // Only Even numbers, the low bit must be zero.
    *lightRegister = brightnessValue | 1; //Turn it on.
    *lightRegister = 0; // Turn it off.
    

    Higher level languages like Java, don’t generally let you write into some random memory location like this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know of a site or page, or know the order of execution
In order to know how many times a pattern exists in current buffer, I
I know that you can apply CSS in order to style objects in Flex
Anyone know of a way to guarantee plugin startup order? I have a plugin
Anyone know if it's possible to databind the ScaleX and ScaleY of a render
There has to be some way to re-write the folowing statement. It's ugly, but
I need to parse a lot of html files in order to know which
I want to know how I can write an Inifile so that I can
I want to know how I can write 64-bit values into memory in C.
I would like to know how to write a Linq (using lambda Expression in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.