0

I want to create an operating system with a graphical user interface using an ILI9431 TFT screen.

Currently I'm waiting for the TFT screen and other components to arrive so I'm playing around with LED's and core features such as something like a BIOS and Kernel which handles the hardware communication and essential low level OS functions.

I'm new to C++ but i know how basic memory allocation works and I'm aware of the dangers what can happen even with proper memory management when creating and freeing many objects on a small SRAM. Is this such a big kind of a deal that I should consider avoid working object oriented or is there a way to make it right?

The only way I know how to create and free an object is this:

SomeClass* obj = new SomeClass():
delete(obj);

When looking over the webs I see many people saying that this is bad and I understand why. I heard of smart pointers, are they working properly on arduino? If yeah, where can I find the classes?

KoalaGangsta
  • 397
  • 1
  • 17
  • Yes smart pointers are good. See this for available implementations: http://stackoverflow.com/questions/5026197/what-c-smart-pointer-implementations-are-available – Meena Alfons Nov 20 '16 at 07:00

1 Answers1

1

I think that you have a lot of confusion and you mixed different concepts in your question. Are you sure that you're able to develop an operating system? Build an operating system is a very long and very complicated task. It requires an extensive knowledge of several aspects of programming and software/hardware architectures.

Object-oriented languages are just a programming paradigm. The main effort to "support" one language or another is the charge of the compiler, not the operating system. Thus it's not dependent on the architecture you run your code, but it depends on the compiler you are using.

ocirocir
  • 3,543
  • 2
  • 24
  • 34
  • Thanks for your time to have a look into my question. Can you explain where i mixed different concepts? My main question is related to memory allocation when i need to create new and delete objects. Yes, I'm pretty sure that I'm able to do what I have in mind, which is obv. far away from an advanced next-gen linux but as my main goal is to learn (like basically the past 8 years, just new since last week to c++ and all of its weird features. But thats not a big deal :)) i sometimes come up with weird projects, but who wants to stop me? ;) – KoalaGangsta Nov 20 '16 at 11:05