Previous thread: What are you working on, Sup Forums?
/dpt/ - Daily Programming Thread
>tfw trying to load a GDT in C a.k.a. portable assembly but I can't without using actual asm
>declaring pointers just fine
>type error
So this is the power of Sup Forums!
>get a job
>can't enjoy videogames anymore
;_;
>>the asterisk is part of the type
yes, the asterisk is part of the function's return type; why insist if you don't know C?
>Refer back to this:
that's not a function definition, do you even?
why does it return true regardless?
for a singly linked list
Because the GDT isn't portable, what do you honestly expect? C can only give you an interface to features that are roughly available on the PDP-11.
Daily reminder there's no better C because nobody has tried to make it yet.
>GDT is not portable
user...
Do you have any evidence that I can't declare pointers, tard? Or are you just spewing your delusions? Looks like projection to me.
There's no better C because Cniles think C is perfect.
>yes, the asterisk is part of the function's return type
The asterisk isn't a part of anything. It's just syntax. "int*" is not its own type, as already demonstrated.
So it's not actually portable assembly? I'd expect to be able to do such a thing when hearing such a phrase
>int* a, b;
>b = (int*)0; // Type error
>projection
please
>GDT not portable
>So it's not actually portable?
stop eating glue
>he keeps going
I see you really enjoyed that anal rape in the last thread, so you came back for more? Boy, you really are a living argument in favor of eugenics.
>I don't know C
We can tell.
I'm sorry, I just hear C being portable assembly and I imagine it can do anything assembly can, but I guess it's just too high-level for that
Load a GDT in C without asm. A portable assembly would be able to do it
((int*) 0)
What is the type of this expression?
Do you have any evidence that I can't declare pointers, tard? Or are you just spewing your delusions? Looks like projection to me.
>as already demonstrated by the retard that can't declare a pointer
BWAHAHAHAHA
>lalalalalalalalala
lad...
>he keeps spewing his subhuman drivel
It's just boring.
>int* denotes a ty...
int* a, b;
b = (int*)0;
Nope. Just syntax, and an inconsistent syntax at that.
How exactly would you turn a non-portable feature into a portable feature, so that it could be included in the C standard?
>No argument
>tfw need asm to setup the OS before calling to C
>tfw need asm to setup paging
>tfw need asm to enable interrupts
>tfw C "the portable assembly" can't do these things
You can't, which is why C is not a portable assembly
>C being portable assembly
yes, and it can do anything that portable assembly can
>I imagine it can do anything assembly can
that would be true only if C were assembly
>it's just too high-level for that
it's portable assembly
>Load a GDT in C
the GDT is not portable while C is portable assembly, what don't you understand? present a portable feature and portable assembly will do it!
>you said "portable assembly" but it's not LITERALLY portable assembly!
>lolololol C BTFO!!!
>"nobody means it literally, you autism"
>lalalalalala NOT AN ARGUMENT!!! LET ME TELL YOU WHAT IT REALLY MEANS
Off you go, tard.
>>What is the type of this expression
>Nope.
Wrong.
>b = (int*)0;
b is not a pointer, moron!
>b is not a pointer
Because int* is not a type.
Provide optional API for it and have some macro defined it the feature is supported in the platform.
More like because you don't know how to declare a pointer.
>int* is not a type
In CSS? Because the C standard says int* is a type.
>he can't into __load_gdt(&descriptor);
found the webshit
But would they then be expected to have a list of officially supported platforms and do this for every version of each one? I guess it's strictly possible, but obviously unrealistic.
>the C standard says int* is a type.
char a, b; // two chars
float a, b; // two floats
double a, b; // two doubles
int a, b; // two ints
SOME_STRUCT a, b; // two SOME_STRUCT instances
int* a, b; // two int pointe...
int* is not a type. This is not up for debate.
How much abstraction is too much?
>int* a, b; // two int pointe
Called it! You don't know how to declare pointers.
>int* is not a type
It is.
>This is not up for debate.
Of course not, the C standard is definitive.
>using someone else's library to write your kernel
Who are you actually calling webshit?
>using someone else's library
you sound like a webshit alright
Friend book &operator>(Money &Lobj, Money &Robj) {return (Lobj > Robj);}
Why the fuck is this breaking my shit?
*Bool not book
C11 provides threading API which is optional, glibc doesn't implement it. I don't understand why would they need any list, though most compiler do list the platforms they support.
That isn't the question I asked, fuckwad. What is the type of the following expression?
((int*) 0)
Anyone applied to IBM here before?
They want a personal statement in the application form. Howl long should it be? A few sentences or around 500-1k characters?
>C is portable assembly
Ctards just keep getting more retarded by the day, LMAO.
Pic related is literally the only correct way to write a kernel in C.
>>C is portable assembly
That's mostly spread by retards who don't know C and don't want to group it with high level languages.
>__
Dumb Ctard.
#define SOME_STRUCT int*
>SOME_STRUCT a, b; // two SOME_STRUCT instances
wrong, fuccboi!
>Called it! You don't know how to declare pointers.
You're just projecting again.
>It is.
If int* was a type, int* a, d; would introduce two integer pointers, just like every other type. Also note that if you want a function pointer, you have to write int (*foo)(int) rather than int (*)(int) foo. The asterisk is just a modifier. A piece of syntax. It's not a part of any type.
You can stop being retard anytime...
>the only correct way to write a kernel in C
>text doesn't mention anything about kernels
how fucking retarded are you, webshit?
>C is portable assembly, but it's not assembly
Amazing
Who are you quoting
Because hardware support is going to vary, often subtly, by platform and that's not really something the C standard addresses.
>people in my course complaining about the quality of the operating system and concurrency fundamentals class
>many of them aren't even bothered to install linux and don't do any of the recommended reading
Are these the future "stack exchange copy paste normie programmers" I hear so much about?
>Who are you quoting
You, fucktard. Boy, you really are having difficulties following the conversation. I'll give you the benefit of the doubt and assume that the massive blood loss from your anus is responsible for your confused state, kid.
>If int* was a type
It is. The standard says so.
>int* a, d; would introduce two integer pointers
No, you clearly don't understand C syntax. The standard explains it.
>Also note
There's nothing to note except you're an idiot.
The only assembly you need to load a GDT is a simple lgdt instruction.
The table itself can be defined just fine in pure C.
You might also need some more assembly to reload the segment registers though.
Do you not understand that a kernel is necessarily operating in a freestanding environment? Am I arguing with a toddler right now?
People who write
int* a, d;
Should not be allowed to push code to my repo.
I don't even care if this was the intended outcome, the patch won't get applied and I will be very skeptical about any changes they come with
>gets told
>s-stop it!
every tiem!
>zero arguments made
I accept your concession, tard.
I never said any of that, come back when you have an argument
C is not fucking portable assembly, you fucking retards.
It's a structured and procedural programming language.
>Amazing
you're amazed that "portable" has meaning and it's not just thrown in there to increase the sentence length? jesus christ, how much more retarded can Sup Forums get?
Please point to the part of the C standard where it states that variables are declared by naming the type then naming the variable.
C does not do this, because C is not sane.
>People who write
>int* a, d;
Of course you wouldn't write that, because it's misleading. int* doesn't declare a type. int does, and the * modifier only applies to a. It's so funny to see you little animals struggling with this.
>The C standard says X!
>The C standard says X!!!
>The C standard says X!!!!!!!!!!!!!
>Please point to the part of the C standard doesn't say X!
Boy, you sure are fucking dumb.
Do you not understand a conforming implementation may have extensions? How fucking mentally ill can you be to not understand the text you're presenting as argument?
Portable assembly would means it's an assembly, which you're saying it's not
For certain you will. I still don't like the feel of "returning" into protected mode by pushing arbitrary values onto the stack, it almost seems like an afterthought. Most likely though it just saves them an instruction.
>Portable assembly would means it's an assembly
Only in your delusional, autistic little mind. Notice how you're the only one taking this expression literally. Just how mentally stunted do you have to be to lack self-awareness to this extent?
I understand it fine, but if you're not gonna write your kernel then how about you just don't fucking write your kernel? Do it properly or give up, webshit.
>The standard has no argument
Well yeah, it doesn't have to justify itself to sub humans webshits, it just dictates whatever it likes. The standard simply declares int* to be a type weather you like it or not.
>b-but muh inconsistency fee-fees
You're irrelevant.
Then the phrase is meaningless if I'm not to take it literally. It's just a high-level language like any other
aka portable assembly
>Portable assembly would means it's an assembly
no, it would "means" it's a portable assembly, can't you read?
>The standard simply declares int* to be a type
It literally doesn't, as demonstrated by your having to resort to autistic screeching as opposed to referencing the standard. Nowhere does it say that int*, in and of itself, declares an integer pointer type. You will demonstrated this with your continued failure to back up your claim that it does.
Define "assembly" and "portable assembly"
>Do it properly
I'm using standard C, so it's proper.
I can, and would assume based on the naming that portable assembly would be a type of assembly, but I guess I'm not supposed to interpret things like a sane person would
I would just say it means access to the full address space, some form of jumping and basic arithmetic.
>Then the phrase is meaningless if I'm not to take it literally
It's only meaningless to the subhuman autist's mind. Actual people are able to infer the meaning correctly. Your subjective feelings about the "meaninglessness" of something are irrelevant, but like every other simple animal, you repeatedly fail at the simplest theory of mind tests.
Standard C isn't good enough to write a kernel, enjoy your GNU extensions :) BTW sepples sucks because no standard abi
The ABI is still stable even if you use GNU extensions retard.
Standard C + extensions. Hey why don't you wear a little dress while you're at it? Grow up.
So basically every systems programming language including C++ and Rust can be considered "portable assembly"
What a stupid fucking definition.
Assembly is nothing more than a textual representation of raw machine instructions. "portable assembly" makes zero sense and is completely fucking retarded.
Nice non-argument. Use terms correctly or not at all. Is C an assembly?
>It literally doesn't
It literally does, calling it "pointer type".
>as opposed to referencing the standard
I already referenced the standard many times while you were struggling to declare a pointer.
>tfw i am on a board with people that cannot declare pointers
I mean if you don't use anything that C++ adds to C, aren't you just using C? The only reason it's said for C rather than other languages is the huge support for C, I guess. Maybe if FORTRAN dominated instead of C we'd be saying it about that.
>would assume
webshits should not be allowed to make assumptions
>EXAMPLE 1 The type designated as ‘‘float *’’ has type ‘‘pointer to float’’. Its type category is pointer, not a floating type.
>The constructions (a) int (b) int * (...) name respectively the types (a) int, (b) pointer to int, (...)
> tfw on board with people who argue about C all day
>I mean if you don't use anything that C++ adds to C
But I do.
>Standard C isn't good enough to write a kernel
It is if you know what you're doing.
>Is C an assembly?
It's portable assembly, we already established that.
inb4 backpedaling & damage control
Even without OS support? Why would you put yourself through that hell?
So it's a portable assembly but not an assembly
Correct. Was that so hard?