How to implement a file system for operating system development [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am using Xfce Ubuntu and building on GCC 10.2. I want to use FAT filesystem or EXT2 filesystem for my hobbyist operating system. I want a specific instruction and specific code for this question, and I am using C to develop my OS. I I want to list directories, make files, read files, and more in the OS. In addition, one is making an 32 bit Protected OS and I use my own kernel, which is not based on Linux or such. Means that I don't have any additional drivers or such. Please help me: how to can I use a filesystem in C (or C++, but I like C more than it) for my own OS?

How to implement a file system for operating system development
You first need to read a text book about operating systems.
You don't use a file system, you implement yours. For inspiration, look into Ext2, VFAT, XFS. Study their source code inside the Linux kernel source.
Of course, you'll need some compiler, so port GCC (as a cross-compiler) to your OS.
See also OSDEV and Linux From Scratch
Budget several years of full time development efforts.

Related

What is the equivalent to WinAPI in Linux and macOS? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I want to create a cross-platform GUI library and I have experience in WinAPI for the window but concerning the other platforms like Linux and macOS, I want to know what is the equivalent to WinAPI(Win32Api) in Linux and macOS?
Every operating system has its own API. Linux API for Linux and Cocoa (API) for Apple's operating systems. Also see Portable Operating System Interface for POSIX compatible operating systems.
There is no direct equivalent. Win32 is a windows specific API. It has no equivalent in other operating systems. Well, it does have something equivalent, but the APIs are completely different.
You have to either use platform specific APIs on each system you support or use some cross-platform library (like Qt or similar) that will work across platforms and abstract away the platform differences for you.
Sadly there isn't any equivalent for WinAPI, but there are good alternatives.
I would recommend SDL 2. It has OpenGL and Vulkan support as well as it's own render functions. It supports Windows, MacOS, Linux, iOS, AppleTV and Android. You even can compile it on unofficially supported platforms. It also supports audio outputs. Also it has many add-ons that can be installed very easily.

Is it possible to create GUI applications with c++ standard native library? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am interested in GUI application development, and when i search for it i found the only way ahead of me is to master in frameworks like qt, wxWidgets, gtk+, win32 etc. Win32 is ofcourse a native way, but it only run on win pc.
Why c++ standard native libraries does not provide APIs for GUI development?, just like like java.
It has every functions of its own to make a fully featured GUI app..?
Most platforms such as Windows, Mac OSX, Unix, Unix derivatives like Linux, and so forth, provide libraries of callable routines or objects which support GUI development on those platforms.
It might be nice to have a universal GUI library, but that would likely limit its features and aesthetics to a particular format and architecture which would necessarily have to exclude some of the most distinctive and useful features of the platform on which such applications would be used.
So one needs to select a platform for development and anticipate parallel development on alternative platforms. Sometimes aesthetics drives these decisions and sometimes capabilities and performance drives them.
Welcome to an endless adventure, good friend.
No.
GUI require graphics. C++ does not require a graphical environment. Unless you implement an OS yourself with graphics drivers etc in C++ you will not be able to do that.
And if you do, you will have re-invented the wheel (Win32).
Edit: As for java it is practically an OS.

Compiling C++ code (BASIC Interpreter) into ARM assembly [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm writing a basic command line operating system for the raspberry pi, much like those on computers from the 70's and early 80's. I have made the basic text input / output with assembly and would like to incorporate a BASIC interpreter into my code. I was thinking of writing my own version of BASIC and an interpreter in C++/Java (maybe not, since it's compiled into bytecode) then compiling it into ARM assembly for the raspberry pi, is this possible?
P.S I considered writing it in assembly, but figured that would be too complicated for my abilities.
Yes, it's possible since once you have a C++ compiler for your taget platform. You can use any language you want/need to, including Java since once all needed tools to compile/interpret are available in the target platform. You can do in assembly too. But do you really need/want to? it's really a lot of job without no much fun.

questions about writing an operating system [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have some very specific questions about writing operating systems that I was hoping could get answered:
How much assembly code would I need to write to load a minimal C Kernel if I use GRUB as a boot loader?
My kernel will be written in C, It will load a command line shell that I wrote in C++, it does not make any API calls only standard library calls, will I need to rewrite the entire C++ Standard library to do so?
Can I write video, keyboard and floppy drivers in C++?
Do GCC and G++ output 16 bit real mode code?
Can I write this all using Mingw on Windows or will I have to write it on Linux?
Do I need to be in real mode in order to write directly to the video memory?
If anyone can answer my questions I will be very thankful
1: You should only need a small amount of assembly to handle the boot process and load the C code. Shouldn't be more than like 20-30 lines I think.
2-4: I haven't really used C++ with OS dev, but I think I remember reading that it takes more work to get it running somewhere. Sorry I can't be of more help.
5: You "can" do it using MinGW, but from my experience it mostly complicates things. I could never really get a Windows environment working, but I also gave up without too much effort.
EDIT: Here is a link to some example assembly. This is all I ever had to use:
http://www.jamesmolloy.co.uk/tutorial_html/2.-Genesis.html
The rest of that site is a pretty good tutorial too if you are at all interested in that kind of thing.

C++ Command-Line program design UI? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am given a task to develop an C++ command-line(terminal, I am using, will run the program in Linux/Ubuntu) display. But I dont like the command-line design, is there anyway to improve the UI design?
Note: I must run the program in terminal!!
ncurses. It's a lib to be able to put text wherever you want in the terminal, so you can effectively draw, ascii-art style in the terminal. It's also a very old library, so it may be a little tedious to use.
I developed a simple multiplatform console management library some time ago.
You can use it at least on Linux and Windows. It uses native calls in Windows, and standard escape codes in other platforms.
If you just want to show some colors, position the cursor, and so on, you can use it in a matter of minutes without struggling with ncurses.
The documentation (generated with doxygen) is included in the Zip file.