The programming thread.

True, but I found it fitting anyway...
Bit of tidbit some company hired me to do a fesiblity of moving minix to 80386 and putting most of the kernel level stuff in protected space (this was after the 386 was announced but before the chip was released). Years prior to that - i think around 1984 or 1986 a friend of mine (who was older and more knowledgeable) worked for a company that was going to try to release unix on a 8088. Naturally this meant the kernel ran in user space and they really couldn't get around the issue of the kernel being corrupted by poorly written user programs still my friend was very proud to demonstrate the 'kernel' multi-tasking on an 8088. Oh well the good old days. Hum. Needless to say the product was a bust.
 
Joined
Jun 26, 2021
Messages
791
Bit of tidbit some company hired me to do a fesiblity of moving minix to 80386 and putting most of the kernel level stuff in protected space (this was after the 386 was announced but before the chip was released). Years prior to that - i think around 1984 or 1986 a friend of mine (who was older and more knowledgeable) worked for a company that was going to try to release unix on a 8088. Naturally this meant the kernel ran in user space and they really couldn't get around the issue of the kernel being corrupted by poorly written user programs still my friend was very proud to demonstrate the 'kernel' multi-tasking on an 8088. Oh well the good old days. Hum. Needless to say the product was a bust.
I found another bit of interesting info, when reading the Wikipedia entry on Minix a few days ago: It says that all Intel chipsets post-2015 are running MINIX 3 internally as the software component of the Intel Management Engine. The German Wikipedia adds, that this makes Minix one of the most widespread operating systems.
Considering the history of Minix this is really ironic.
 
Joined
Dec 26, 2007
Messages
2,195
I found another bit of interesting info, when reading the Wikipedia entry on Minix a few days ago: It says that all Intel chipsets post-2015 are running MINIX 3 internally as the software component of the Intel Management Engine. The German Wikipedia adds, that this makes Minix one of the most widespread operating systems.
Considering the history of Minix this is really ironic.
It's astonishing. Wikipedia states it as if it were the original MINIX 3, but it's only a supposition. It started with the discovery of strings found while reverse-engineering the firmware, then later, a Google employee and a few others gave a talk in 2017 about it and their concern with its security (video, slides). So that all but confirms that the Intel Management Engine would be based on Tanenbaum's baby, and even running a small web server (users normally don't have access).

It's another great use of the BSD licence, exactly as Sony did starting with the PlayStation 3 by building its OS on FreeBSD and NetBSD.

Ironic indeed. The professor's work finally caught up with the pesky Finnish student's. ;)

EDIT: I see the video of the talk is 2017, not 2019 as I saw elsewhere, so I changed it
 
Last edited:
Joined
Aug 29, 2020
Messages
12,482
Location
Good old Europe
That talk linked above is actually quite impressive.

Time to switch to ARM (or not...). ;)
I will make this comment; having known a few of these people (not the fellow speaking). Both google and facebook have or had incredible engineers (i've been less impressed with the folks i know at apple and ms); Some of these folks make 99% people look dumb. There are some truly gifted people out there (of course there are a lot of non-gifted people in decision making positions everywhere). Like all people some of these gifted folks are extremely giving and nurturing and some are your typical assholes. Anyway while I've not loved where google has gone as a corporation don't under-estimate their eng staff (same for facebook).

And yes the presenter is quite good both in clarity and correctness. It is truly how awful some of Intel decisions have been with regards to what they have put in the lower layers of the kernel both in terms of efficiency and security (and no i never really paid attention to those layers of the system on intel; though in the early days i paid more attention). It makes sense that a lot of this stuff is bloated beyond belief (er makes sense from a marketing/business perspective not from a technical perspective).
 
Last edited:
Joined
Jun 26, 2021
Messages
791
True, and it's the case of many companies, I suspect. It's easy to say that X or Y is evil, but there are mostly good people behind those facades, and the reasons the companies have turned out bad are multiple and sometimes complex because of the environment they're in (market, etc). I don't like the company but I know a few Google employees very well, and there's nothing bad about them.

I see that this NERF project has migrated but is still on, though not very active: Linuxboot. There are a few others, like coreboot and Das U-Boot - you've got to love those punny names, sometimes.
 
Joined
Aug 29, 2020
Messages
12,482
Location
Good old Europe
True, and it's the case of many companies, I suspect. It's easy to say that X or Y is evil, but there are mostly good people behind those facades, and the reasons the companies have turned out bad are multiple and sometimes complex because of the environment they're in (market, etc). I don't like the company but I know a few Google employees very well, and there's nothing bad about them.

I see that this NERF project has migrated but is still on, though not very active: Linuxboot. There are a few others, like coreboot and Das U-Boot - you've got to love those punny names, sometimes.
I do hope that some of these linux distrubtion get rid of this crap in the kernel firmware. Some of it is unfortunatley burned in the rom but a lot can be replaced at boot time. I understanding the marketing side of allow vendors such as dell to insert 'value added stuff users don't want'; but the security flaws it introduces.....
 
Joined
Jun 26, 2021
Messages
791
I do hope that some of these linux distrubtion get rid of this crap in the kernel firmware. Some of it is unfortunatley burned in the rom but a lot can be replaced at boot time. I understanding the marketing side of allow vendors such as dell to insert 'value added stuff users don't want'; but the security flaws it introduces.....
I don't see any Linux distribution getting involved in that. Why would they?

That part of the firmware is in a flash. There's no problem reprogramming it, but it has to fit in the available space (typically a few MB).
 
Joined
Aug 29, 2020
Messages
12,482
Location
Good old Europe
Talking about Linux, I keep seeing links to this page describing a project running Debian on the Intel 4004, sort of. If you don't know it, it's an old 4-bit CPU. With 12-bit addresses and a stack of 3 levels. :D

Since the 4004 is obviously too limited, the 4004 emulates a MIPS R3000, which in turn runs Linux. The R3000 is old too, but it's a 32-bit CPU with an MMU, at least (the 4004 was out in 1971 and the R3000 in 1988).

The short article:

This is the (much longer) page of the project. There's an accelerated video giving an idea of the speed; make sure to check the clock in the background.

PS: It's a lot for a small 4004. If you prefer something more reasonable, you can check this page, that simulates a Busicom 141-PF, the first CPU-based calculator. And yes, it's coded in Rust.
 
Joined
Aug 29, 2020
Messages
12,482
Location
Good old Europe
My first CUDA program

#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>

__global__ void hello_cuda ()
{
printf("Hello CUDA world\n");
}

int main()
{
hello_cuda << <1, 20 >> > ();
cudaDeviceSynchronize();
cudaDeviceReset();

return 0;
}

I had to use good ol' printf, not cout, i guess I would have to add that one as an argument to the kernel call.

The output:
HelloCuda.jpg

pibbuR who was amazed at how fast the program ran.
 
Joined
Nov 11, 2019
Messages
2,698
Location
beRgen@noRway
It's about organizing threads in the GPU. The parameters in this example says that I use one block, with 20 threads. 4,8 would indicate 4 blocks of threads, with 8 threads in each.

Why not just write 1,16, or 1,n? I'm learning more about this right now.

EDIT: I tried <<<1, 2000> - didn't like that. But <<<10,200>>> was apparently acceptable.

{pibbuR} are (it's a set) having fun!!!!

EDIT 2: A block can have up to 1024 threads. But blocks are further organized in grids, which can contain thousands of blocks.
 
Last edited:
Joined
Nov 11, 2019
Messages
2,698
Location
beRgen@noRway
Enthusiastic answer (and a joke): Of course.
Truthful answer: Hard to tell (=very unlikely) with this simple-and-not-very-demanding program.

pibbuR who expects more reliable answers as he learns more (10% so far on a Udemy course)
 
Joined
Nov 11, 2019
Messages
2,698
Location
beRgen@noRway
Winamp has released the source code and is hoping that people will collaborate to its development. It's taken some flak because it comes with a weird licence that prevents people from distributing the modified software (but still, the repo has been forked more than a thousand times so far).


It's mostly C/C++.

 
Joined
Aug 29, 2020
Messages
12,482
Location
Good old Europe
In the /boot of FreeBSD, I found scripts in Forth...

beastie.4th delay.4th logo-beastiebw.4th menu.4th version.4th
brand-fbsd.4th efi.4th logo-fbsdbw.4th menusets.4th
brand.4th frames.4th logo-orb.4th screen.4th
check-password.4th loader.4th logo-orbbw.4th shortcuts.4th
color.4th logo-beastie.4th menu-commands.4th support.4th

I suppose it's safe... :censored:

I'd hate to debug it, though. Here's a tiny bit of it:
Code:
: boot
  0= if ( interpreted ) get_arguments then
  \ Unload only if a path was passed
  dup if
    >r over r> swap
    c@ [char] - <> if
      0 1 unload drop
    else
      s" kernelname" getenv? if ( a kernel has been loaded )
        try-menu-unset
        bootmsg 1 boot exit
      then
      load_kernel_and_modules
      ?dup if exit then
      try-menu-unset
      bootmsg 0 1 boot exit
    then
  else
    s" kernelname" getenv? if ( a kernel has been loaded )
      try-menu-unset
      bootmsg 1 boot exit
    then
    load_kernel_and_modules
    ?dup if exit then
    try-menu-unset
    bootmsg 0 1 boot exit
  then
  load_kernel_and_modules
  ?dup 0= if bootmsg 0 1 boot then
;

PS: Don't worry, there are lua scripts, too.
 
Joined
Aug 29, 2020
Messages
12,482
Location
Good old Europe
In the /boot of FreeBSD, I found scripts in Forth...

beastie.4th delay.4th logo-beastiebw.4th menu.4th version.4th
brand-fbsd.4th efi.4th logo-fbsdbw.4th menusets.4th
brand.4th frames.4th logo-orb.4th screen.4th
check-password.4th loader.4th logo-orbbw.4th shortcuts.4th
color.4th logo-beastie.4th menu-commands.4th support.4th

I suppose it's safe... :censored:

I'd hate to debug it, though. Here's a tiny bit of it:
Code:
: boot
  0= if ( interpreted ) get_arguments then
  \ Unload only if a path was passed
  dup if
    >r over r> swap
    c@ [char] - <> if
      0 1 unload drop
    else
      s" kernelname" getenv? if ( a kernel has been loaded )
        try-menu-unset
        bootmsg 1 boot exit
      then
      load_kernel_and_modules
      ?dup if exit then
      try-menu-unset
      bootmsg 0 1 boot exit
    then
  else
    s" kernelname" getenv? if ( a kernel has been loaded )
      try-menu-unset
      bootmsg 1 boot exit
    then
    load_kernel_and_modules
    ?dup if exit then
    try-menu-unset
    bootmsg 0 1 boot exit
  then
  load_kernel_and_modules
  ?dup 0= if bootmsg 0 1 boot then
;

PS: Don't worry, there are lua scripts, too.
That's because it is FREEbsd; now if you had looked at PAIDbsd it would be much easier to read ;)
--
I did run freebsd for about 12 years - and it was kind of a pia (and costly since they were so anti-eide - this was in the mid 90's to mid 2000's - around the time Apple purchased Jordan. I was working for a company that did stuff in linux (2000-2020); so at some point i got tired of dealing with freebsd package manager and switched to linux - well specicifically ubuntu - after trying 5 or 6 different distributions (fedora, and a few others) and that is where i've been since - of course when ubuntu added zfs ready packages that sealed the cake as i was tired of building custom kernels with zfs. ZFS is really fantastic - not as good as netapp's top secret filesystem but close but this is another topic (and of course fantastic, good, ... are based off of my critera which might be contradictory to yours; but either way even today brts is a pile of horse radish waiting for you to skinny dip esp if you run raid of any sort).
 
Joined
Jun 26, 2021
Messages
791
Back
Top Bottom