473,651 Members | 2,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can we program a hardware with c++ ?

RabahMabhoul
6 New Member
hello!

I was wondering weither I can write a System like ext4 HTFS FAT with c++ programing language, and if there's a link to a book that explain all the fundimental of programming language and how they involved ! please answer back !
May 24 '15 #1
7 1738
computerfox
276 Contributor
Rabah,

What's with all the yelling in the threads?
As I explained in the original thread, C++ isn't used in too many places other than education as C is still the preferred. C++ is very high-level so systems are especially not written in C++. Even Windows is written in C until it can bring in the .Net framework. C has the best of both worlds, high level and lower level like assembly. C++ was C re-written.

A simple Google search could have given you more information:
https://www.google.com/?gws_rd=ssl#q...ramming+with+C

There would also be memory allocation issues, memory leak issues, functions in C++ that aren't recognized, C++ is not meant for low level programming.

Here's more information on low level development:
http://wiki.osdev.org/Main_Page

Hope that helps!
May 24 '15 #2
kiseitai2
93 New Member
I have taken an electronics course before that used C. The reason C is preferred when you are playing with the hardware is mostly because of overhead issues. The problem is not really most of the points computerfox mentioned. The issue is mostly that you may or may not be working with a circuit that has low RAM and storage capabilities (as low as 1KB of RAM and a couple of megs of storage (at best)). C++ has many nice features that on paper makes it a more attractive language than C; however, these C++ features will make your binary fatter and will increase the RAM requirement for your program. C, on the other hand, forces you to rewrite some of these features from scratch and/ or rethink your strategy such that you make leaner and faster code. Now, you may think 1 KB of RAM is nothing, but it is actually a considerable amount when using C and when you write smart and efficient code. Thus, the hierarchy is to write the foundation of your system (low level layer) in C or assembly, write the intermediate components in C++ or other similarly strong language, and write the uppermost layers with languages as simple as scripting languages like Python. My rule of thumb is, if I am constraint by the circuit and/or the feature is critical to my solution to the problem, I should probably use C. I hope my explanation helps.
May 24 '15 #3
weaknessforcats
9,208 Recognized Expert Moderator Expert
All true.

C++ is to avoid coding mistakes in applications. Plus there are compiler generated calls that you need to be aware of. Hence the bloat.

There are no applications close to the metal so I wouldn't be using C++ there.
May 26 '15 #4
RabahMabhoul
6 New Member
Thank you for those special answers !
if for example I want to develop softwares for windows witch language should I chose !
May 31 '15 #5
RabahMabhoul
6 New Member
and the question that delve in my head this time what is the
difference between assembly and c ? if they are both low level programming languages !

1- Is assembly included in c ? or c is an advanced version of assembly ?

2-is c programming languages do every thing that assembly language do -?
May 31 '15 #6
weaknessforcats
9,208 Recognized Expert Moderator Expert
What kind of software for Windows?

If it's an application that is to run on the web you might be using C#. If it is an internal OS extension feature yu will probably need to use Microsoft's version of C - plus all their naming conventions (don't get me started).

As to assembly language and C it's this way:

The C compiler generates assembly code. This assembly code is converted machine language using an assembler (also a compiler). When you build a C program these two compilers are used to get your object file.
May 31 '15 #7
donbock
2,426 Recognized Expert Top Contributor
Another difference between C and assembly language is that it is possible (if you're careful) to write portable programs in C that can run without alteration on any computer that has a C compiler; while each processor has its own custom assembly language. Assembly language programs are not portable.

On the other hand, portability is not much of an issue when writing a device driver -- which, by definition, is specific to a particular hardware platform. Nevertheless, it is almost always easier to move a no portable C program from one platform to another than it is to rewrite an assembly language program for a different processor.

Engineers sometimes speak of "embedded systems" -- a product that contains a processor (a coffee pot, a router, a car, etc). C can be used for to program embedded systems, but be careful - embedded systems are typically "freestandi ng implementations ", a phrase used in the C Standard for an implementation that is permitted to provide only a small subset of the Standard C Library.
Jun 1 '15 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1462
by: Mark | last post by:
We have a particular software project where a minority of the function calls are taking up a majority of the cpu time. (they do a lot of geometric, trig and other functions related to vectors corresponding to tracks in 3d space) We think there's not much more that can be done to speed these functions up on the computer we have (or can have). The question is, aren't there available now hardware cards that you can load with particular...
29
3938
by: tele-commuter | last post by:
Hi folks, I want to understand how exactly is an image(compiled c code and loaded into memory) stored in memory. What exactly is a linker script? I work with a lot of c code on a daily basis but I really don't understand :
14
1666
by: noridotjabi | last post by:
Two questions. 1)Is there any way that I can read from an executable and then execute what I have read. EXAMPLE: text text this is more text
110
10552
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst case scenario for MyISAM backend? Also is it possible to not to lose data but get them corrupted?
2
2319
by: Sheikko | last post by:
Hi, I am deveopping an application on the pocket pc and I need to program hardware buttons to toggle between 2 application. Exactly from the code of the first application I open a second application and throught the keys of my device I want to toggle between these two application. I want to send this second application in background. I can do this with hardware buttons, but this method use the winowsCE namespace, but I'm using pocket ce....
5
2526
by: mohamed azaz | last post by:
hi I want to know can c++ deal with hardware?? like fax modem or Lan or Audio device
1
2058
by: sewid | last post by:
Hi there! I've got a problem with no solution, I hope you might help me. I am writing a small tool with many buttons. Every button starts a thread and this thread starts something else, in the example posted below, the hardware configuration dialog. My problem is, that sometimes when I close the executed program / application / dialog, my program is displayed in background. When I execute the taskmanager, everything works fine, but...
1
2022
by: Wizfrog | last post by:
Hello, is there ways to access hardware from C#? In particluar, I am looking to change screen luminosity (or brightness/contrast values) from within a C# program. Hardware drivers / control panels can do that, but I'm not sure how to access these features... any idea which direction to look for? Thanks
4
1301
by: Angus | last post by:
Hello My program works with different types of telephone system. Their interfaces are all different. But, of course, I don't want to have to write a different program for each system. There is a LOT of code in the existing program which interfaces with just one telephone system. I can re-use a lot of that. But I want a flexible interface to the hardware.
0
8352
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8802
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7297
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1909
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1587
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.