How can a person write a terminal from 0?

How can a person write a terminal from 0?
For example I have the C language, how can a person write a terminal without external libraries? It's impossible or maybe I'm just a rust fag that doesn't understand anything.

Attached: wp3790957.jpg (1080x1920, 223K)

You can make anything with C if you're good enough

This
But why would you, tho

Terry Davis did it

That's why I want to know how to do it, I already have schizophrenia!

How much is from scratch? How deep down the rabbit hole are you willing to go? Can you use a graphics toolkit? If no, where do you draw the line? You're always relying on something else. If you're not willing to use graphics libraries, why are you OK with using an OS? Are you ok with using a CPU architecture somebody else designed?
Unless you make your hardware by yourself, are you really programming a terminal from scratch?

Im p sure I know this person whats her name?

Wrong, Holly C is a mod of C and C++. He used the C standard library. If you're even using printf, you're already importing a lot of stuff that you didn't build from scratch.

asap rocky

I call her weed-chan!
Okay... Hmm yess.. let's say I'm in the 90 and I need to write the first ever terminal for GNU/Linux.

Nah its some ethot over in StCharles, fuck off you normie fag

You don't write a terminal. A terminal is a piece of hardware.

Right. So then you're absolutely depending on external libraries.

Let's invert the problem. Let's say you're given a computer with no OS. All you can use are the CPU instructions designed by the engineers. Can you write a terminal in one single program? Yes, but I have absolutely no idea where you should even start.

In practice nobody works like that. You always depend on third party libraries, from your programming language's standard library, to the OS' libraries, to toolkits that simplify every aspect of your program.

nigga what
he didn't use any previous C standard library.
he created his own from scratch
HolyC does not follow any ISO specifications

>HolyC does not follow any ISO specifications
So what? Many C distributions didn't either before the ANSI; that doesn't mean that they didn't use commin libraries. The fact that X is non-standard means that it doesn't satisfy the standard 100%, not that it uses 0% of it. If Terry had built his own programming language, it wouldn't be known as a mod of C and C++, just like trans-women are not women.

I am talking about the implementation of the userspace C library that is provided to the user. He implemented that for the operating system himself. There are no 3rd party libraries in TempleOS

you mean terminal emulator? just look at the code for st and and figure it out yourself

Just use assembly

In order to bake a pie from scratch you must first invent the Universe.


So, by that logic, you start with the kernel.

>the first C compiler was written in C
Now THAT'S some black magic kinda shit.

It is.

Its called Bootstrapping the compiler. You start with an minimal OS kernel that offers just enough features support the bootstrapping operation. Boot into that and you are prompted to insert a few floppies (at least I was). In the first stage, a simple macro assembler (hand written) reads in some bytecode files (also hand written) and assembles them to machine code libraries and a new macro assembler -- to build the next stage. Each stage builds pre-reqs and a new assembler (from hand written macro code) for the next stage. There could be a few as 7 and as many as 30 stages of this freaky shit, and it all just goes on it's own.

The version of gcc I bootstrapped required 14 stages. I did this on a Pentium 120MHz and 64MB of RAM. The entire operation took about 17 solid hours of run time. When it was finished, I had a working copy of gcc, as, ld, and the basic bare bones C libraries. Just enough to build a linux kernel and glibc from source.

>just like trans-women are not women
why are you obsessed with traps, user?

Thankfully, if you start out from an existing Unix system, often far less passes are required.
The current worst path to get a recent GCC compiler still looks like this:
system compiler -> gcc 3.3 (last version compatible with K&R C) -> gcc 4.7 (last version completely written in C) -> current gcc (-> current gcc, rebuilt using itself)
I don't know how many rebuilds of the GNU binutils and library dependencies this includes.

This.
The only ever correct way to learn how to do something is to look at the code/doc at existing projects.

Start with an old one or one that aims towards simplicity, like st.
Then figure out ones that have more features/advanced practices/follow more standards, but trying out to make something that works without going through the termcaps doc or Xlib doc is just stupid and a loss of time.
I'm not telling you to #include every related piece of code, just figure out how they work.

But then it's Assembly that created C, not C

Literally suckless.
Lookup st

I suggest you to take a look at st sources, it might help

dilate

A terminal is just a program that interfaces the shell. Literally a wrapper. Just follow POSIX. Its harder on windows.

You have been visited by Laura Dyatlov.

This thread is currently reading 28 replies (not great, not terrible).

Attached: Laura.jpg (1275x637, 107K)

not so fast bitch

Who’s this autistic to leave these sage comments on all pg10 threads?

Me, I guess.