Live data from Hacker News

Minimal x86 Kernel Zig

github.com

51–60 of 71 posts

Re: Minimal x86 Kernel Zig

#52
post #16

Earlier quoted context omitted.

What's the point writing another kernel in C ???

Considering that we are talking about experimental toys which have lower odds of seeing production than of you winning a national lottery jackpot, the point of writing it in C would be the same as the point of writing it in anything else - IOW, the kernel is the objective, not the language used to write it. .

[deleted]

Re: Minimal x86 Kernel Zig

#53
post #16

Earlier quoted context omitted.

What's the point writing another kernel in C ???

Considering that we are talking about experimental toys which have lower odds of seeing production than of you winning a national lottery jackpot, the point of writing it in C would be the same as the point of writing it in anything else - IOW, the kernel is the objective, not the language used to write it. .

If you read yourself you'll realize your answer i highly toxic, quiet honestly completely irrelevant, discouraging other people from doing what they like. I would get rid of people with your attitude, you are the kind of problem I don't want to have to deal with and more than that, I don't want to have juniors have to deal with you. Please realize that you had your chance and you played it. Nobody ow you an explanation if you can't even get basics up.

Re: Minimal x86 Kernel Zig

#54
post #12

What's the point of doing this in "Zig" instead of C, the traditional choice for this kind of thing?

bitpacked structs, good enums, arbitrary sized integers, optionals + non-nullable pointers, fast compiler, zig fmt, unit testing, ability to use standard library and the rest of the third-party ecosystem on freestanding, std.ArrayList, std.AutoArrayHashMap, std.MultiArrayList, std.crypto, more productive type system, comptime, SIMD, slices, labeled switch continue, error handling, custom panic handler, stack traces on freestanding, error return traces, zero bit types, the build system, package management, aligned pointers, untagged union safety, multi-object for loops, inline switch cases, semantically guaranteed inline functions, inline loops

Re: Minimal x86 Kernel Zig

#55
post #28

Why to spread confusion and call it bare metal when it's run under QEMU? Then it's not bare metal at all. In order to be run on bare metal it's needing another bootloader which the documentation only barely mentions. More on the naming: why to call it kernel?

You still need a bootloader to run the Linux kernel.

well, not with efistub, at least, depending on how you define bootloader.

Re: Minimal x86 Kernel Zig

#56
post #49
post #39

Earlier quoted context omitted.

Would you say its always slower, or always faster?

No. I will continue my crusade against blanket statements about performance.

Gee, good thing I didn't make a blanket statement and qualified it by saying "often", which is true, my contrarian dude. https://tigerbeetle.com wouldn't have chosen it unless they found it faster than C- and there's a significant quantity of money riding on that decision, so it likely wasn't done lightly at all.

The rest, you can google yourself, but in short, sorry to tell you that it is sometimes faster. Often, sometimes, some portion of the time.

Re: Minimal x86 Kernel Zig

#57
post #53

Earlier quoted context omitted.

Considering that we are talking about experimental toys which have lower odds of seeing production than of you winning a national lottery jackpot, the point of writing it in C would be the same as the point of writing it in anything else - IOW, the kernel is the objective, not the language used to write it. .

If you read yourself you'll realize your answer i highly toxic, quiet honestly completely irrelevant, discouraging other people from doing what they like. I would get rid of people with your attitude, you are the kind of problem I don't want to have to deal with and more than that, I don't want to have juniors have to deal with you. Please realize that you had your chance and you played it. Nobody ow you an explanati…

What in the sweet chili dipping sauce did I walk into?

drnick1 says why "Zig" not C? [I took the quotation marks as dismissive of Zig, but I could be misreading that]

6r17 says why do it in C?

lelanthran says the language is mostly irrelevant, it's a fun experiment.

6r17 blows off the handle and starts calling people toxic and being really unpleasant.

Nothing in this comment chain seems to justify even 1/10th of the vitriol espoused.

Re: Minimal x86 Kernel Zig

#60
post #28

Why to spread confusion and call it bare metal when it's run under QEMU? Then it's not bare metal at all. In order to be run on bare metal it's needing another bootloader which the documentation only barely mentions. More on the naming: why to call it kernel?

The kernel is Multiboot compliant, so it's already compatible with real bootloaders. Creating a disk image with a real bootloader wouldn't be much extra code, but if your point is just to demonstrate a 'bare-bones' Zig kernel, is it really necessary?
Post reply on HN