Reply by March 10, 20182018-03-10
Ilias Abrams <iliasabrams@gmail.com> wrote:
> > Thanks David, I would like to focus on this more. The 1GB memory that I said is only for example. Can you please give more details? Microcontrollers work on that way? Basically I want to write a program with no OS. Only my software run on the hardware and have 1-1 mapping meaning my physical address space translated to logical addresses. I dont know so much yet about programming but I think that C make use of the logical addresses and not the physical but with 1-1 mapping maybe can achieve this.
I would suggest to look at some _very_ simple example. One possiblility is a LED blineker program. For STM32 you can find simple example at: http://math.uni.wroc.pl/~p-wyk4/embed2016/pr/f0/blink1.c at http://math.uni.wroc.pl/~p-wyk4/embed2016/pr/f0/Makefile you have corresponding Makefile and at http://math.uni.wroc.pl/~p-wyk4/embed2016/pr/f0/libopencm3_stm32f0.ld you have linker script. In STM32 location of memory is defined by external pins, you need to read processor documentation for details. Linker script tells linker where memory is supposed to be so that program can be correctly linked (of course definitions in linker script must agree with what processor is doing, so to write correct script you need to know processor documentation). -- Waldek Hebisch
Reply by Gunther Mannigel March 3, 20182018-03-03
Am 27.02.2018 um 19:11 schrieb Ilias Abrams:
> You are absolutely right. Lets start again, I am a student and I have a project. I want to work on ARM architecture and not on x86. I am working some C examples on RPI2 and 3 and also I have a microcontroller Tiva C TM4C123G Launchpad. > I want to right a baremetal software that can save registers values into the memory address like stack lets say and print those values from memory to screen. But I want to use C and assembly (maybe inline assembly) and I want to use physical addresses (If its not possible to use directly the physical addresses maybe I can achieve a 1-1 mapping logical to physical)
Hi Ilias, with a Tiva, you can use the Ressource Explorer to open examples which are bare metal. Start there. :-) sincerely Gunther
Reply by Paul March 1, 20182018-03-01
In article <p75qhl$74k$1@dont-email.me>, david.brown@hesbynett.no 
says...
> > On 28/02/18 08:31, Jack wrote: > > Il giorno marted&#4294967295; 27 febbraio 2018 19:11:09 UTC+1, Ilias Abrams ha > > scritto:
....
> > Guide you is the job of your professor, he is paid for it, so use > > him. > > > > Said that, forget the RPi, you can't use it bare metal, too > > complicated. > > > > Start with an Arduino (but it's not ARM) or some board from mbed.org > > (they have ARM). Start with something simple, like an ARM of the > > Cortex M family (there is a good book about the Cortex M: "The > > Definitive Guide to ARM Cortex M", you'll find it on Amazon). > > > > If you want to start with something smaller Atmel AVR are good (used > > in Arduino), or NXP (Freescale) HCS08 (Book: "HCS08 Unleashed", very > > good, with examples). > > > > I am sceptical to Arduino. It is easy to get started with, but gives > you a sort of half-C, half-C++ environment with far too many of the > important bits hidden away. You can't control the compiler properly, > you can't get warnings properly, you can't even see where the code you > are using comes from because headers are hidden. There is a lot of > lasagne programming (something as simple as controlling a GPIO pin, that > is a single instruction on an AVR, goes up and down through half a dozen > layers of "abstraction"). Yes, you can quickly do simple things with it > - but it does not teach you good programming or development practices, > and is not a way to make early versions of code. It would have been a > better system if they had used a language like BASIC rather than their > C/C++ hybrid, as it would then be clear that you are using it for > experimentation and testing ideas, not for developing a final system.
I generally would not recommend Arduino unless a customer insists on it! By customer I also include Educational use as I am often asked to assist on projects as the only things the schools have are Arduinos. Which more chip manufacturers steered away from it, looked at one chip manufacturers 'Arduino' style board support to work in Arduino IDE, set compiler warnings to ALL, then wtached an empty sketch compile and give LOTS of warnings. Yes you can copy errors to clipboard (not warnings) when you should be able to copy them to a new TAB in the IDE. In one case the warnings output, TRIMMED to remove blank lines and the few successful modules, was still 585 lines long ! I occassionally use Arduino for THROW AWAY proof of concept or one off testing knowing the limitations of the Arduino software core and libraries. Common problems with the core processing Inability for IDE to make it more obvious how to do multiple modules easily with tabs, which have limited type support so you cannot have readme or other plain text documentation tabs. Lack of consistent error reporting from lower levels Hidden problems on one board type USB support had an event of USB disconnect and comment was // Must find way to report this to higher level Silent dropping of buffer overruns, main buffer overrun methods are for Incoming data, throw it away and no error logged anywhere Outgoing data Spin lock and hope some interrupt is still working to empty buffer. Poor and inefficient coding Too often many things are classes that should not be Inconsistent buffer handling, on one board type there was THREE DIFFERENT implemantations of Ringbuffer handling Worst ringbuffer class, was fixed size inside the class for buffer and only functions to store data in the buffer, all other operations supported by higher functions. Poor details for many board types on RAM usage Lack of proper MAKE style building with compiled libraries of core for each type of board, continual filling of temp directories with ever increasing build numbers and rebuilding too many parts. Many other issues, mainly NIH and everything must work on UNO first and be geared for that. ...
> The standard today for small systems is Cortex-M. If you are learning > embedded programming, use devices with these cores. The other realistic > cores are MIPS (for the PIC32) and - I hope - RISC-V in more future > devices. But the great thing about using a decent core that can be used > with standard C and C++ programming using top-line tools is that the > core becomes mostly irrelevant. You don't have to learn "C programming > for the AVR", or "C programming for the 8051", with all their > idiosyncrasies and odd extensions - you just learn "C programming" and > it works on them all.
Hopefully works on all having seen too many chip manufacturers libraries with horrendous bugs and bloat Personally looking round Cortex-M types and major issue across all vendors is documentation and porr coding (mainly just release something and maybe we will update it later). -- Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.pcserviceselectronics.co.uk/LogicCell/> Logic Gate Education <http://www.pcserviceselectronics.co.uk/fonts/> Timing Diagram Font <http://www.badweb.org.uk/> For those web sites you hate
Reply by David Brown February 28, 20182018-02-28
On 28/02/18 08:31, Jack wrote:
> Il giorno marted&igrave; 27 febbraio 2018 19:11:09 UTC+1, Ilias Abrams ha > scritto: >> &Tau;&eta; &Tau;&rho;&#943;&tau;&eta;, 27 &Phi;&epsilon;&beta;&rho;&omicron;&upsilon;&alpha;&rho;&#943;&omicron;&upsilon; 2018 - 1:34:17 &mu;.&mu;. UTC, &omicron; &chi;&rho;&#942;&sigma;&tau;&eta;&sigmaf; David >> Brown &#941;&gamma;&rho;&alpha;&psi;&epsilon;: >>> On 27/02/18 11:34, Ilias Abrams wrote: >>>> &Tau;&eta; &Tau;&rho;&#943;&tau;&eta;, 27 &Phi;&epsilon;&beta;&rho;&omicron;&upsilon;&alpha;&rho;&#943;&omicron;&upsilon; 2018 - 7:51:33 &pi;.&mu;. UTC, &omicron; &chi;&rho;&#942;&sigma;&tau;&eta;&sigmaf; >>>> David Brown &#941;&gamma;&rho;&alpha;&psi;&epsilon;: >>>>> >>>>> What sort of systems are you talking about here? Very >>>>> roughly, you can divide processors into two categories. >>>>> >>>> >>>>> >>>>> And there are "small" ones designed for running a single >>>>> program, either "bare metal" or with a small "real-time >>>>> operating system", with all the code compiled and linked at >>>>> one time. Then the logical addresses and physical addresses >>>>> are the same, and you often don't have any kind of memory >>>>> protection at all. >>>>> >>>>> >>>> Thanks David, I would like to focus on this more. The 1GB >>>> memory that I said is only for example. Can you please give >>>> more details? Microcontrollers work on that way? Basically I >>>> want to write a program with no OS. Only my software run on the >>>> hardware and have 1-1 mapping meaning my physical address space >>>> translated to logical addresses. I dont know so much yet about >>>> programming but I think that C make use of the logical >>>> addresses and not the physical but with 1-1 mapping maybe can >>>> achieve this. >>>> >>> >>> You are not making much sense here. It is like saying you'd like >>> to go on a car holiday, and would prefer a manual gear car to an >>> automatic. No one could give you advice because they don't know >>> where you want to go, what you want to do, if you want to buy a >>> care or hire it, or anything else. >>> >>> Or it is like going to an author's conference and saying "I'd >>> like to write a book. Perhaps it will be hardback, but that's >>> just an example. Do the numbers on the bottom of the pages match >>> the physical sheets of paper in book printing?" >>> >>> Saying "I want to write a program" is equally vague. We have no >>> idea if you are trying to program on a PC, or have bought a >>> microcontroller based embedded card, or even if you have a target >>> at all. We have no idea what your program would be doing, or >>> what you know or don't know about the matter. >>> >>> We don't know if you are a student trying to get help with some >>> homework, a professional who has been given a task way outside >>> your experience, or a hobby developer just trying to learn >>> something new. >>> >>> You have to take a step back and think about what you know, and >>> where you want to go, and try to give a better description of it. >>> And be ready for when the advice you get is "don't start with C" >>> or "don't worry about physical memory mappings - you'll get there >>> in a couple of years". >> >> You are absolutely right. Lets start again, I am a student and I >> have a project. I want to work on ARM architecture and not on x86. >> I am working some C examples on RPI2 and 3 and also I have a >> microcontroller Tiva C TM4C123G Launchpad. I want to right a >> baremetal software that can save registers values into the memory >> address like stack lets say and print those values from memory to >> screen. But I want to use C and assembly (maybe inline assembly) >> and I want to use physical addresses (If its not possible to use >> directly the physical addresses maybe I can achieve a 1-1 mapping >> logical to physical) What are your thoughts about that? Can you >> guide me what I have to do? Thanks! > > Guide you is the job of your professor, he is paid for it, so use > him. > > Said that, forget the RPi, you can't use it bare metal, too > complicated. > > Start with an Arduino (but it's not ARM) or some board from mbed.org > (they have ARM). Start with something simple, like an ARM of the > Cortex M family (there is a good book about the Cortex M: "The > Definitive Guide to ARM Cortex M", you'll find it on Amazon). > > If you want to start with something smaller Atmel AVR are good (used > in Arduino), or NXP (Freescale) HCS08 (Book: "HCS08 Unleashed", very > good, with examples). >
I am sceptical to Arduino. It is easy to get started with, but gives you a sort of half-C, half-C++ environment with far too many of the important bits hidden away. You can't control the compiler properly, you can't get warnings properly, you can't even see where the code you are using comes from because headers are hidden. There is a lot of lasagne programming (something as simple as controlling a GPIO pin, that is a single instruction on an AVR, goes up and down through half a dozen layers of "abstraction"). Yes, you can quickly do simple things with it - but it does not teach you good programming or development practices, and is not a way to make early versions of code. It would have been a better system if they had used a language like BASIC rather than their C/C++ hybrid, as it would then be clear that you are using it for experimentation and testing ideas, not for developing a final system. I am also highly sceptical to recommending the HCS08 - or any of the old 8-bit CISC cores. These have played their part in the embedded world, many of them for far longer than they should have. Let them go, and let their old non-standard tools go with them. For anyone getting into this game now, pick a device with good, modern compiler support that you can program in real standard C or C++. The AVR is a border-line case - you can use normal standard programming for everything except constant data in flash memory. I'd say it's okay for small uses, but once you have more than 64K devices you are back in the mess of segmented memories. (The same applies to msp430 over 64K - up to that limit, it is very nice, clean 16-bit architecture.) The standard today for small systems is Cortex-M. If you are learning embedded programming, use devices with these cores. The other realistic cores are MIPS (for the PIC32) and - I hope - RISC-V in more future devices. But the great thing about using a decent core that can be used with standard C and C++ programming using top-line tools is that the core becomes mostly irrelevant. You don't have to learn "C programming for the AVR", or "C programming for the 8051", with all their idiosyncrasies and odd extensions - you just learn "C programming" and it works on them all. The decision then comes down to the kind of hardware you want, the kind of demo boards that suit your interests, the kind of software support (libraries, demo code, etc.) that suits you. Of course, if you just want to get a taste for embedded programming and controlling things, forget all about individual boards and buy a Lego Mindstorms kit. That will get you the feeling of building and controlling stuff far faster, and you can move on from there.
Reply by Jack February 28, 20182018-02-28
Il giorno marted&igrave; 27 febbraio 2018 19:11:09 UTC+1, Ilias Abrams ha scritto:
> &Tau;&eta; &Tau;&rho;&#943;&tau;&eta;, 27 &Phi;&epsilon;&beta;&rho;&omicron;&upsilon;&alpha;&rho;&#943;&omicron;&upsilon; 2018 - 1:34:17 &mu;.&mu;. UTC, &omicron; &chi;&rho;&#942;&sigma;&tau;&eta;&sigmaf; David Brown &#941;&gamma;&rho;&alpha;&psi;&epsilon;: > > On 27/02/18 11:34, Ilias Abrams wrote: > > > &Tau;&eta; &Tau;&rho;&#943;&tau;&eta;, 27 &Phi;&epsilon;&beta;&rho;&omicron;&upsilon;&alpha;&rho;&#943;&omicron;&upsilon; 2018 - 7:51:33 &pi;.&mu;. UTC, &omicron; &chi;&rho;&#942;&sigma;&tau;&eta;&sigmaf; David Brown &#941;&gamma;&rho;&alpha;&psi;&epsilon;: > > >> > > >> What sort of systems are you talking about here? Very roughly, you can > > >> divide processors into two categories. > > >> > > > > > >> > > >> And there are "small" ones designed for running a single program, either > > >> "bare metal" or with a small "real-time operating system", with all the > > >> code compiled and linked at one time. Then the logical addresses and > > >> physical addresses are the same, and you often don't have any kind of > > >> memory protection at all. > > >> > > >> > > > Thanks David, I would like to focus on this more. The 1GB memory that > > > I said is only for example. Can you please give more details? > > > Microcontrollers work on that way? Basically I want to write a > > > program with no OS. Only my software run on the hardware and have 1-1 > > > mapping meaning my physical address space translated to logical > > > addresses. I dont know so much yet about programming but I think that > > > C make use of the logical addresses and not the physical but with 1-1 > > > mapping maybe can achieve this. > > > > > > > You are not making much sense here. It is like saying you'd like to go > > on a car holiday, and would prefer a manual gear car to an automatic. > > No one could give you advice because they don't know where you want to > > go, what you want to do, if you want to buy a care or hire it, or > > anything else. > > > > Or it is like going to an author's conference and saying "I'd like to > > write a book. Perhaps it will be hardback, but that's just an example. > > Do the numbers on the bottom of the pages match the physical sheets of > > paper in book printing?" > > > > Saying "I want to write a program" is equally vague. We have no idea if > > you are trying to program on a PC, or have bought a microcontroller > > based embedded card, or even if you have a target at all. We have no > > idea what your program would be doing, or what you know or don't know > > about the matter. > > > > We don't know if you are a student trying to get help with some > > homework, a professional who has been given a task way outside your > > experience, or a hobby developer just trying to learn something new. > > > > You have to take a step back and think about what you know, and where > > you want to go, and try to give a better description of it. And be > > ready for when the advice you get is "don't start with C" or "don't > > worry about physical memory mappings - you'll get there in a couple of > > years". > > You are absolutely right. Lets start again, I am a student and I have a project. I want to work on ARM architecture and not on x86. I am working some C examples on RPI2 and 3 and also I have a microcontroller Tiva C TM4C123G Launchpad. > I want to right a baremetal software that can save registers values into the memory address like stack lets say and print those values from memory to screen. But I want to use C and assembly (maybe inline assembly) and I want to use physical addresses (If its not possible to use directly the physical addresses maybe I can achieve a 1-1 mapping logical to physical) > What are your thoughts about that? Can you guide me what I have to do? > Thanks!
Guide you is the job of your professor, he is paid for it, so use him. Said that, forget the RPi, you can't use it bare metal, too complicated. Start with an Arduino (but it's not ARM) or some board from mbed.org (they have ARM). Start with something simple, like an ARM of the Cortex M family (there is a good book about the Cortex M: "The Definitive Guide to ARM Cortex M", you'll find it on Amazon). If you want to start with something smaller Atmel AVR are good (used in Arduino), or NXP (Freescale) HCS08 (Book: "HCS08 Unleashed", very good, with examples). Bye Jack
Reply by Ilias Abrams February 27, 20182018-02-27
&Tau;&eta; &Tau;&rho;&#943;&tau;&eta;, 27 &Phi;&epsilon;&beta;&rho;&omicron;&upsilon;&alpha;&rho;&#943;&omicron;&upsilon; 2018 - 1:34:17 &mu;.&mu;. UTC, &omicron; &chi;&rho;&#942;&sigma;&tau;&eta;&sigmaf; David Brown &#941;&gamma;&rho;&alpha;&psi;&epsilon;:
> On 27/02/18 11:34, Ilias Abrams wrote: > > &Tau;&eta; &Tau;&rho;&#943;&tau;&eta;, 27 &Phi;&epsilon;&beta;&rho;&omicron;&upsilon;&alpha;&rho;&#943;&omicron;&upsilon; 2018 - 7:51:33 &pi;.&mu;. UTC, &omicron; &chi;&rho;&#942;&sigma;&tau;&eta;&sigmaf; David Brown &#941;&gamma;&rho;&alpha;&psi;&epsilon;: > >> > >> What sort of systems are you talking about here? Very roughly, you can > >> divide processors into two categories. > >> > > > >> > >> And there are "small" ones designed for running a single program, either > >> "bare metal" or with a small "real-time operating system", with all the > >> code compiled and linked at one time. Then the logical addresses and > >> physical addresses are the same, and you often don't have any kind of > >> memory protection at all. > >> > >> > > Thanks David, I would like to focus on this more. The 1GB memory that > > I said is only for example. Can you please give more details? > > Microcontrollers work on that way? Basically I want to write a > > program with no OS. Only my software run on the hardware and have 1-1 > > mapping meaning my physical address space translated to logical > > addresses. I dont know so much yet about programming but I think that > > C make use of the logical addresses and not the physical but with 1-1 > > mapping maybe can achieve this. > > > > You are not making much sense here. It is like saying you'd like to go > on a car holiday, and would prefer a manual gear car to an automatic. > No one could give you advice because they don't know where you want to > go, what you want to do, if you want to buy a care or hire it, or > anything else. > > Or it is like going to an author's conference and saying "I'd like to > write a book. Perhaps it will be hardback, but that's just an example. > Do the numbers on the bottom of the pages match the physical sheets of > paper in book printing?" > > Saying "I want to write a program" is equally vague. We have no idea if > you are trying to program on a PC, or have bought a microcontroller > based embedded card, or even if you have a target at all. We have no > idea what your program would be doing, or what you know or don't know > about the matter. > > We don't know if you are a student trying to get help with some > homework, a professional who has been given a task way outside your > experience, or a hobby developer just trying to learn something new. > > You have to take a step back and think about what you know, and where > you want to go, and try to give a better description of it. And be > ready for when the advice you get is "don't start with C" or "don't > worry about physical memory mappings - you'll get there in a couple of > years".
You are absolutely right. Lets start again, I am a student and I have a project. I want to work on ARM architecture and not on x86. I am working some C examples on RPI2 and 3 and also I have a microcontroller Tiva C TM4C123G Launchpad. I want to right a baremetal software that can save registers values into the memory address like stack lets say and print those values from memory to screen. But I want to use C and assembly (maybe inline assembly) and I want to use physical addresses (If its not possible to use directly the physical addresses maybe I can achieve a 1-1 mapping logical to physical) What are your thoughts about that? Can you guide me what I have to do? Thanks!
Reply by Mel Wilson February 27, 20182018-02-27
On Tue, 27 Feb 2018 02:36:48 -0800, Ilias Abrams wrote:
[ ... ]
> Thanks David, I would like to focus on this more. The 1GB memory that I > said is only for example. Can you please give more details? > Microcontrollers work on that way? Basically I want to write a program > with no OS. Only my software run on the hardware and have 1-1 mapping > meaning my physical address space translated to logical addresses. I > dont know so much yet about programming but I think that C make use of > the logical addresses and not the physical but with 1-1 mapping maybe > can achieve this.
The quickest way to get hands-on experience is to check out the Arduino, and its comprehensive web site <https://www.arduino.cc/> After that, a more general environment, AVRFreaks, for example. With the more general software you can dig in to the .h files and linker control files to see what's being done for you. Also the datasheets and programmer's documentation for whatever line of processors you've chosen. Read, read, read.
Reply by David Brown February 27, 20182018-02-27
On 27/02/18 11:34, Ilias Abrams wrote:
> &Tau;&eta; &Tau;&rho;&#943;&tau;&eta;, 27 &Phi;&epsilon;&beta;&rho;&omicron;&upsilon;&alpha;&rho;&#943;&omicron;&upsilon; 2018 - 7:51:33 &pi;.&mu;. UTC, &omicron; &chi;&rho;&#942;&sigma;&tau;&eta;&sigmaf; David Brown &#941;&gamma;&rho;&alpha;&psi;&epsilon;: >> >> What sort of systems are you talking about here? Very roughly, you can >> divide processors into two categories. >> > >> >> And there are "small" ones designed for running a single program, either >> "bare metal" or with a small "real-time operating system", with all the >> code compiled and linked at one time. Then the logical addresses and >> physical addresses are the same, and you often don't have any kind of >> memory protection at all. >> >> > Thanks David, I would like to focus on this more. The 1GB memory that > I said is only for example. Can you please give more details? > Microcontrollers work on that way? Basically I want to write a > program with no OS. Only my software run on the hardware and have 1-1 > mapping meaning my physical address space translated to logical > addresses. I dont know so much yet about programming but I think that > C make use of the logical addresses and not the physical but with 1-1 > mapping maybe can achieve this. >
You are not making much sense here. It is like saying you'd like to go on a car holiday, and would prefer a manual gear car to an automatic. No one could give you advice because they don't know where you want to go, what you want to do, if you want to buy a care or hire it, or anything else. Or it is like going to an author's conference and saying "I'd like to write a book. Perhaps it will be hardback, but that's just an example. Do the numbers on the bottom of the pages match the physical sheets of paper in book printing?" Saying "I want to write a program" is equally vague. We have no idea if you are trying to program on a PC, or have bought a microcontroller based embedded card, or even if you have a target at all. We have no idea what your program would be doing, or what you know or don't know about the matter. We don't know if you are a student trying to get help with some homework, a professional who has been given a task way outside your experience, or a hobby developer just trying to learn something new. You have to take a step back and think about what you know, and where you want to go, and try to give a better description of it. And be ready for when the advice you get is "don't start with C" or "don't worry about physical memory mappings - you'll get there in a couple of years".
Reply by Ilias Abrams February 27, 20182018-02-27
&Tau;&eta; &Tau;&rho;&#943;&tau;&eta;, 27 &Phi;&epsilon;&beta;&rho;&omicron;&upsilon;&alpha;&rho;&#943;&omicron;&upsilon; 2018 - 7:51:33 &pi;.&mu;. UTC, &omicron; &chi;&rho;&#942;&sigma;&tau;&eta;&sigmaf; David Brown &#941;&gamma;&rho;&alpha;&psi;&epsilon;:
> On 26/02/18 23:07, Ilias Abrams wrote: > > Hi guys, > > > > I am new on software programming and I am trying to understand some > > basic/ important things.I am interested in Bare-metal software > > programming, so please give me answers related on this. My question > > is: who is responsible and manage the physical memory mapping / > > allocation? Meaning, If I have 1GB physical memory on my system, the > > 1) CPU or 2) the Bootloader (like GRUB, U-boot) is responsible for > > the memory addresses that I can use for my program? Is hardware > > specific architecture? Each platform manufacture has their own memory > > address mapping scheme and layout? Furthermore, is there any standart > > way that you have to partition the physical memory? meaning, give > > some memory for I/Oports and so on? > > > > Sorry for the mess, but I dont understand when you create/ build your > > software, how you know what range of physical addresses you can use > > for start/entry point, stack and so on. > > > > Please help me to clear all this in my mind. If you can give me > > examples will help me more P.S. Programming in C > > > > Thanks > > > > What sort of systems are you talking about here? Very roughly, you can > divide processors into two categories. > > There are "big" ones designed for running multiple programs from > different sources. These use a "memory management unit" which maps the > logical addresses (seen by the program code) into physical addresses > (used by the memory itself). The OS is responsible for setting up this > mapping, and making sure each process can only access the memory it is > allowed to use. > > And there are "small" ones designed for running a single program, either > "bare metal" or with a small "real-time operating system", with all the > code compiled and linked at one time. Then the logical addresses and > physical addresses are the same, and you often don't have any kind of > memory protection at all. > > > "Bare metal" programming means there is no OS or significant software > layers between the main code and the hardware - and that usually means > small devices with no memory mappings. GB memory sizes usually means > big devices with a full OS (like Linux). But there are some cross-over > areas - bootloaders like Grub and OS kernels are "bare metal" on the big > devices. > > > Memory allocation is a completely different issue. It is always handled > by software, but may be done in different ways in different levels.
Thanks David, I would like to focus on this more. The 1GB memory that I said is only for example. Can you please give more details? Microcontrollers work on that way? Basically I want to write a program with no OS. Only my software run on the hardware and have 1-1 mapping meaning my physical address space translated to logical addresses. I dont know so much yet about programming but I think that C make use of the logical addresses and not the physical but with 1-1 mapping maybe can achieve this.
Reply by Ilias Abrams February 27, 20182018-02-27
&Tau;&eta; &Tau;&rho;&#943;&tau;&eta;, 27 &Phi;&epsilon;&beta;&rho;&omicron;&upsilon;&alpha;&rho;&#943;&omicron;&upsilon; 2018 - 7:51:33 &pi;.&mu;. UTC, &omicron; &chi;&rho;&#942;&sigma;&tau;&eta;&sigmaf; David Brown &#941;&gamma;&rho;&alpha;&psi;&epsilon;:
> On 26/02/18 23:07, Ilias Abrams wrote: > > Hi guys, > > > > I am new on software programming and I am trying to understand some > > basic/ important things.I am interested in Bare-metal software > > programming, so please give me answers related on this. My question > > is: who is responsible and manage the physical memory mapping / > > allocation? Meaning, If I have 1GB physical memory on my system, the > > 1) CPU or 2) the Bootloader (like GRUB, U-boot) is responsible for > > the memory addresses that I can use for my program? Is hardware > > specific architecture? Each platform manufacture has their own memory > > address mapping scheme and layout? Furthermore, is there any standart > > way that you have to partition the physical memory? meaning, give > > some memory for I/Oports and so on? > > > > Sorry for the mess, but I dont understand when you create/ build your > > software, how you know what range of physical addresses you can use > > for start/entry point, stack and so on. > > > > Please help me to clear all this in my mind. If you can give me > > examples will help me more P.S. Programming in C > > > > Thanks > > > > What sort of systems are you talking about here? Very roughly, you can > divide processors into two categories. >
> > And there are "small" ones designed for running a single program, either > "bare metal" or with a small "real-time operating system", with all the > code compiled and linked at one time. Then the logical addresses and > physical addresses are the same, and you often don't have any kind of > memory protection at all. > >
Thanks David, I would like to focus on this more. The 1GB memory that I said is only for example. Can you please give more details? Microcontrollers work on that way? Basically I want to write a program with no OS. Only my software run on the hardware and have 1-1 mapping meaning my physical address space translated to logical addresses. I dont know so much yet about programming but I think that C make use of the logical addresses and not the physical but with 1-1 mapping maybe can achieve this.