Tiny Core Linux
Off-Topic => Off-Topic - Tiny Core Lounge => Topic started by: xor on July 23, 2020, 01:42:41 AM
-
In terms of the philosophy of minimalism, it also needs to consume little resources in time and labor.
artificial intelligence; automatic HW identification and driver download
Especially for someone trying to learn this system for the first time, the processes of identifying non-universal, variable hardware and finding and installing drivers are unnecessary waste of time and effort.
artificial intelligence ; automatic identification of equipment, and downloading of drivers automatically
lshw
lspci
lsusb
lsblk
lscpu
lsmem
Can you write a simple and easy script that does everything right in this regard!
-
That isn't AI. That is called scripting.
By saying equipment, what do you mean ? - Wireless Adapter Drivers ? GPU Drivers ? Display Drivers ? Keyboard Drivers ? Mice ?
-
What ? I don't understand poetric language.
-
That isn't AI. That is called scripting.
all artificial intelligence are programs that do only what is desired.
a real artificial intelligence; does not respond to requests.
By saying equipment, what do you mean ? - Wireless Adapter Drivers ? GPU Drivers ? Display Drivers ? Keyboard Drivers ? Mice ?
any HW hardware equipment that needs driver downloads for use
-
It is obvious that the problems I read mostly have problems with the video card driver and wifi modem driver!
By saying equipment, what do you mean ? - Wireless Adapter Drivers ? GPU Drivers ? Display Drivers ? Keyboard Drivers ? Mice ?
-
For downloading, we would need a wifi or ethernet. But if we have wifi problem and no ethernet, then that script would be of no use.
-
I'm not talking about a problem that has happened.
literally utopian solutions
I am trying to discuss the creation of the road map of the future :)
For downloading, we would need a wifi or ethernet. But if we have wifi problem and no ethernet, then that script would be of no use.
-
Strong AI or Weak AI?
In my experience, most people are all talk and no action. And few people plan or think rationally about the subject. Of course there was AI winter, both 1 and 2, but now we have "A.I. irrational exuberance"; setting the scene for "A.I. Winter III".
But America DOES love a ridiculous sequel. Luckily the rest of the world continues to think rationally and logically about the coming Post-Moore's Law Era.
My name is Randall Meyer. I post here as ladnar or doctoranonymous. I also post on a 6502 forum. I think you would like some of my posts about raspberry pi, picore, tinycore, vision science, image sensors (CCDs and CMOS; Goldberg Polyhedra!), 6502, and StrongAI.
First step to any Strong AI is good hardware. Audio, Visual, Tactile, Olfactory and Gustatory. A good read of Locke or Hume is also a fine introduction. Impressions (perceptions?). Ideas. Memes. Mnemes.
Seems to me, the Linux community, in general, should work towards standardizing these "channels".
I am just a lowly biologist, with a smattering of Linux commands under my belt, and even I know a simple bash script could add a few more "standard directories" for archival sensory storage.
I call it Meyer's Standard Strong Artifical Intelligence Directories. MSSAID.
SHEBANG!
mkdir vis.
mkdir aud
mkdir tact
mkdir olf
mkdir gust
And yet, no smellovision? No sniffer sensor? No taster sensor? The other sensory channels have good hardware, commercially available, cheap. These two channels? Not so much?
But of course, wallstreet wants a dumb-AI, because they are tired of tipping cabbies and uber-drivers, so, you know .... what wallstreet wants, wallstreet gets!
And a biologist like me, a person who has thought about Strong AI for (essentially) every waking adult second since 2001, incorporating his AI company in 2004, and since reduced to turning over couch cushions for change to buy robot parts and scientific equipment, well, a person like me is left wondering if the real changes, the necessary changes, will ever take place?
-
HINT: Surface Acoustic Wave Transducers ... Wave of the future, dude. Maybe?
-
At the risk of looking equal parts lazy and stupid, here is my bash script which does essentially nothing, except outline the future.
I know how to start a bash script, but maybe not how to end it? I think you just save it with .sh at the end ; then change with chmod to be executable?
You'll see the last few lines I left indistinct? Who should be allowed to alter a Strong AI's sensory memories? I would argue "nobody", but for development purposes, ?maybe?, suggest "anybody" ! chmod 777 !
#! /bin/bash
cd /
mkdir /strongai
mkdir /strongai/opt
mkdir /strongai/aud
mkdir /strongai/tact
mkdir /strongai/olf
mkdir /strongai/gust
chdir -m 777 mydir
mkdir -m a=rwx [directories]
chdir -m 777 mydir
Most "standard" Linux folders are just a few letters? Maybe not "/strongai" ; maybe just "/sai" .
I dunno. Just a thought.
-
Well, I think AI looks like a too big thing for this. We could use lspci, lsusb, hwinfo, lshw to find them. But my question is how do you find what kind of the device it is when you don't have its driver ?
Once we know its category, then we can mess up the provides.db and then find the tczs required for the device to work.
-
physical hardware has a unique ID number that allows them to be identified on their connection ports.
it's not the operating system that reads it
usually defines motherboard bios.
to access these contents
lshw
lspci
lsusb
lsblk
lscpu
Even MS windows recognizes hardware and requests drivers.
this is a usb camera, etc. etc.
https://usb-ids.gowdy.us/read/UD/
https://usb-ids.gowdy.us/read/UC/
http://pci-ids.ucw.cz/read/PC/
http://pci-ids.ucw.cz/read/PD/
with a logically simple coding
lshw => ID Xyz123 (usb port) => = usb (Xyz123) wifi.tcz (download.)
Well, I think AI looks like a too big thing for this. We could use lspci, lsusb, hwinfo, lshw to find them. But my question is how do you find what kind of the device it is when you don't have its driver ?
Once we know its category, then we can mess up the provides.db and then find the tczs required for the device to work.
-
Hi xor
... with a logically simple coding ...
Since you think it's simple, go ahead and code it.
-
I am definitely an outsider, and just a lowly biologist, but YOUR UNIVERSE IS HUGE! I mean, the universe of computer scientists. But its MY UNIVERSE too!? Technically? I live here, and witness it, in all its insane glory.
What I mean to say, There is more hardware in heaven and earth than are dreamt of on your coffee break. So as long as, "ahem", "the free market" is in charge of , "ahem", "innovation", standards will be lax, and new standards will be invented ('ahem", "pushed"), and perfect systems to identify perfect devices in a perfect world will remain elusive.
But, xor, as rich suggested, if it seems simple, give it a whirl.
(I am no coder" but I almost made a useful bash script today. Got hung up on some simple permissions stuff, but I ironed it out by violating Asimov's Laws of Robotics--Androidics?Gynoidics?Anthropoidics? It seems, that if I just neglect the rights of Artificial Life, I can chmod 777 and let the whole world monkey with their code; manipulate their memories? Poor, AI? Can't exist without giving up its freedoms through a simple chmod 777 command! But, then again, many of us Linux freaks are FOSS/GNU/Copyleft freedom fighters, so, permissions all around, I guess?!)
I see the thread has moved for being OT. I blame myself. Here is my code; I tried it out on a fresh piCore11, today, and it works. I added it to my bootlist and filetool and ran the backup command. I don't really know what all that stuff means, but it helps it be persistent. Maybe I could learn that TCZ thing and make it an "extension", or whatever? Here is my code:
#! /bin/bash
cd /
sudo chmod 777 /
mkdir -m 777 /sai/misc
mkdir -m 777 /optic
mkdir -m 777 /aud
mkdir -m 777 /tact
mkdir -m 777 /olf
mkdir -m 777 /gust
Natural intelligence has a "dedicated, standardized", "hardware" (of sorts), determined (partially) by DNA, and thus, cells, tissues, organs, systems, etc.
All the "fun" AI I want to deal with, already knows its hardware, even if I--and my more grandiose, less "driver" software--haven't got a clue.
(I'm so "green" I thought MAC addresses were always hardware specific; i.e. unique identifiers, to specific machines; but I forced two of my pi zeros to have the same ethernet/hw adress/MAC address (twelve hex characters, colon separated pairs) yesterday. Good thing I was alone when I figured it out, because I was kind of embarrassed I didn't know this?)
[Edit: Nope. I checked my notes. I forced one board to have a different ethernet/hwaddr/MACaddr, for two separate sessions. The other board kept its MAcaddr. for several boots. Bad memory; my wet chemistry. Data, data, everywhere, yet not a thought to think!]
-
Here is an On-Topic comment. "cat /proc/cpuinfo" tells me my serial number on my pi zero boards.
And, come to think of it, I think I did read about IP spoofing, and maybe MAC address spoofing too? So maybe I am not as "green" as I thought?
Is there no blkid on piCore? And isn't lspci for a pci bus? I guess for tinycore thats useful, but I am a piCore guy.
(Maybe it's time I commit to Tiny Core. I have an extra laptop that is collecting dust with its crappy, constantly updating Windows 10; constantly threatening to freeze the device with every new and useless, forced upload. A scam to get me to buy a new laptop? Perhaps? Maybe I could look into a dual boot: Windows 10 and tinycore?). Oh look., I'm OT again. It doesn't take much!
-
I started to think that this isn't possible.
We could use lspci and lsusb with updated pci.ids and usb ids so that we could get the name of the wireless device.
Then we should manually :
Find the chipset of the driver using Google.
Go here : https://en.wikipedia.org/wiki/Comparison_of_open-source_wireless_drivers and find the correct driver fro the chipset.
Get the driver from the tczs in the repo.
-
I was starting to think it WAS/IS possible. At the very least, a simple bash script could combine all these functions, weed out the unnecessary info, and put all your hardware IDs in one file, for easy reference.
I woke up this morning with half a bash script in my head ...
And stumbled on this page too ...
https://linux.die.net/sag/hwutils.html
So, here's a start. You'll notice that my code is both lazy and stupid (not to mention, non-functional; just an outline of an idea.). I will work on it in my "down time", but I have a cluster computer to build and have to learn USB gadget, RNDIS, cdc ethernet, MACaddress, Static IP, LKM/.ko module updates, etc. , etc.
Also note, this is just to list things in one easy place. I wouldn't know how to set it up to crawl the internet to grab the needed drivers.
SHEBANG!
#! /bin/bash
cd /
lshw
#grepping
lspci
#catting
lsusb
#listing and saving in a .txt file
lsblk
#more grepping
lscpu
#more listing
lsmem
# etc, etc , etc
cat /proc/cpuinfo
blkid
fdisk -l
I feel like shell scripts should end with a special statement, too? Like, maybe #K@Z@m! But like I said, I am just a biologist; an outsider. You are under no obligation to listen to my suggestions. Maybe I will just put it in behind a "#", thus commented out! I could start a trend, or fad, in shell scripting!
Downside to a shell script? Wikipedia says :
"Another significant disadvantage is the slow execution speed and the need to launch a new process for almost every shell command executed. When a script's job can be accomplished by setting up a pipeline in which efficient filter commands perform most of the work, the slowdown is mitigated, but a complex script is typically several orders of magnitude slower than a conventional compiled program that performs an equivalent task.
There are also compatibility problems between different platforms. Larry Wall, creator of Perl, famously wrote that "It is easier to port a shell than a shell script." "
-
Last month I was studying Linux ports. Not receptacles, of a physical nature, but "conceptual ports". Conceptual sockets. Networking ports and sockets. I forgot everything I learned, but will tackle it again, soon.
The stupid-lazy script I offered above, would ideally access such ports; listening and/or "polling" such ports. The "extended hardware" ... ?
But I suppose, maybe not? Once the kernel and brains have found a port, it is safe to say the kernel has found all the hardware it needs in order to talk through that port. And the kernel is not querying other machines about their hardware and drivers? And if it does, it relies on the other computer to know its own devices and hardware and drivers. So, probably not.
Also, on another note; like picore11 doesn't have blkid. Maybe some kind of loop to skip it? Or a simple, non-verbose line printed to CLI explaining which commands, of the long list of hardware listing commands, were not performed?
Also, I know nothing of dstat, but maybe? My kali linux laptop doesn't have it. But a quick check online says it replaces iostat, vmstat, netstat, etc. Kali DOES have those. But they seem more like "function-assessment" utilities, not "absence or presence" , enumeration utilities.
-
Some careful grepping and catting of dmesg could glean part #s and manufacturer #s.
-
Hi ladnar
... Also, on another note; like picore11 doesn't have blkid. ...
Are you sure? Do you get the same response for this command:
tc@box:~$ which blkid
/sbin/blkid
tc@box:~$
The shebang should not be written like this:
#! /bin/bash
It should always be the first line in the script and written like this:
#!/bin/bash
Yes, it will still run if it is not the first line.
Yes, it will still run with the extra space.
Yes, it will cause failures if a program needs to determine whether your file is a script.
No, you should no longer visit the website that taught you that bad habit.
... I see the thread has moved for being OT. I blame myself. ...
You only served as a reminder. I should have moved it in July when it was started.
-
Thanks Rich. I have had too much coffee and not enough sleep. I think I will stop posting and have a mid-morning nap.
Good advice on the shebang. I probably just mis-learned it, not taught wrong.
I will try "which blkid" after a nap.
In the interest of staying on topic, I re-read all the messages. I was missing some subtle points from sashank999, and some subtleties of the whole topic in general. If the CPU doesn't have a driver, and thus a way to communicate with the hardware, how does it know what hardware is there and which driver it needs?
Good question.
I think xor is making the point that there is some low-level communication that allows for this. I don't know if lshw and lspci and etc. respond to this "low level" signaling? Is it a smart enough signaling to tell, to the cpu, the peripheral/hardware device manufacturer number and product id? I have to assume xor knows what he is talking about.
With my cluster computer problem, I am using ethernet gadget USB. Last night I was studying OTG wires (something I embarrassingly neglected before this moment), and crucial to this implementation is a pin that is left floating if the wire is inserted one way, but grounded when inserted another way. This signals the USB controller(s) (chips), determining which chip will be the master (host) and which the slave (device). Once this low-level signaling occurs, this physical configuration established, the chips can begin to initiate the bus. This is just an example; admittedly an indistinct example. Just an example of low-level, hardware signaling that occurs before "speaking" to the cpu through a driver (I am pretty certain the USB chips set this up as soon as they are plugged in, with no input from the cpu or drivers. I could be wrong? But I figure once the chips get the simple stuff out of the way, the CPU and driver can start telling the USB controller what to do, what to send and what to receive.)
Ethernet gadget mode requires extra software; LKM, .ko modules, loaded? / interfaced? with the kernel. But now I am very OT; obsessed with my bramble-pi cluster!
So to summarize, hardware, when it is plugged in, can signal simple things like "ground on this wire", or "power on this wire". Beginning with simple things like this, one or two transistors might flip, and begin some low-level "Hello, I am here. My name is XYZ. the company that made me is ABC."-type communication. "Handshaking" type stuff. Does lspci and lshw and etc have THIS information? Or must one "dig deeper" to access this info?
I DEFINITELY don't know. Do you? (OK, its 7:30 Pacific time; up since 3 AM; must nap now.).
-
...
So to summarize, hardware, when it is plugged in, can signal simple things like "ground on this wire", or "power on this wire". Beginning with simple things like this, one or two transistors might flip, and begin some low-level "Hello, I am here. My name is XYZ. the company that made me is ABC."-type communication. "Handshaking" type stuff. Does lspci and lshw and etc have THIS information? Or must one "dig deeper" to access this info?
I DEFINITELY don't know. Do you? (OK, its 7:30 Pacific time; up since 3 AM; must nap now.).
all i know is that i know nothing ! .. but after reading the hw/usb speculation in this topic , and searching i found a diagram* in a 'book'
https://sysplay.github.io/books/LinuxDrivers/book/Content/Part11.html ( copy @ https://i.imgur.com/rcCRJYF.png )
(https://i.imgur.com/rcCRJYF.png)
+ wrt kernal/usb https://www.kernel.org/doc/html/latest/usb/index.html
.. and a few other random linux usb documentation links ,
- https://www.kernel.org/doc/html/v4.13/driver-api/usb/writing_usb_driver.html
- ( Docs » The Linux driver implementer's API guide » Linux USB API » The Linux-USB Host Side API )
this https://wiki.linuxaudio.org/wiki/raspberrypi#usb_audio
also springs to mind , as an example of one microcosm of (raspberry/hw) implementation specific ambiguity and fun
eg > The RPi has a USB2.0 controller that apparently can cause issues with USB1.1 audio interfaces.
( see pi forums kernel / firmware "issues" for more `depth` ;- )
-
Its lsblk that picore does not have. blkid is there. There is a list of utilities that come with Busybox on the internet somewhere. I might be curious enough to check and see if lsblk is on there somewhere? Maybe I'll check the list of available tcz's (extensions?) too?
-
Thanks mocore.
I should have warned you. I hate every diagram about USB that I have ever encountered. Every last one of them is as clear as mud. As the son of a "copper-wire-twisted-pair-dinosaur-from-the-telephony-days" (telegraph, single wire, earth-return? Say it ain't so!), I have to say that these companies who write up the textbooks took a nice simple elegant topic and futz-ed it all up!
Differential signaling on twisted pair doesn't have to be rocket science. I bought 4 books on the subject, looking for a straight answer about "what does the signal look like", and I got a whole lot of "J and K" nonsense. That's not to say that the books were wrong; It just took four books, and 60 chapters to say what could have been summed up in three introductory chapters.
But, of course, it is an evolving standard, and it is complex, so I can cut them some slack. The best one I found was McDowell and Seyer (about 75% good information), but some of the things (the other 25%) they should have included I had to find in Jan Axelson's books (I owned 3 of hers!).
-
Hi ladnar
Its lsblk that picore does not have. ...
According to this list, installing util-linux.tcz will provide that function:
http://tinycorelinux.net/11.x/armv6/tcz/util-linux.tcz.list
... There is a list of utilities that come with Busybox on the internet somewhere. I might be curious enough to check and see if lsblk is on there somewhere? ...
To see which busybox commands have been enabled, run these 2 commands:
busybox
busybox.suid
-
hi ladnar,
A couple of points:
Bash may not be loaded by default. If not use #!/bin/sh
"exit" is the end command in a script. exit 0 is implied. Stick it in if you like.
Script speed is relative. piCorePlayer uses 30,000 lines of shell as a http CGI, performance is more than adequate.
Seeing "chmod 777" raises alarm bells to me!!
-
Seeing "chmod 777" raises alarm bells to me!!
I knew I was being bad. But with an OS that lives on RAM (and a coupla blank uSD cards in my pocket) I am living dangerously.
And, technically, Asimov's three rules of robotics aren't broken. Firstly, I do not need a "worker" or "slave", as the Czech word "robota" would imply (Rossum's Universal Robots, circa 1925, Karel Capek). I am more in the vein of Homer's Illiad and/or Odyssey; Hephasteus, Tripods, and Golden Girls for a blacksmith's apprentice. Its an older dream, than our recent nightmares. Vacaunson's digestive duck, perhaps?
What, for curiosities sake, is the worst that chmod 777 can do, on a RAM resident OS, air gap, SBC?
(My robotics obsession began around 2003, after reading Noam Chomsky's "Syntactic structures" and Daniel Dennett's "Darwin's Dangerous Idea". I decided "Syntax is for the birds" and "Semantics is where it's at". I was also reading Hume's discussion of "impressions" and "ideas", and Paul Thompson's book "The Structure of Biological Theories", wherein he discusses the Syntactic conception of theory structure, vs. his preferred embodiment, the Semantic formalization. I won't pretend to have understood it all (I think I am a Syntactic person, when it comes to formal theories, but I appreciate a little "Semantic looseness" everywhere else!), but I somehow got it in my head that VN^2=S ; That is, for an Aritficial or Natural Intelligence possessing N number of Nouns and V number of Verbs, VN^2 number of simple semantic sentences, S, was the maximum that could be intelligently composed. A lovely little permutation derivation, if ever there was one.
Of course the INTELLIGENT intelligent sentences are a much smaller subset than S would imply. intelligence is, after all, situational. So, I guess its simple then, huh? All we have to do is make a device that CAN speak all of the sentences, S, but, for various reasons, chooses not to. Easey Peasey, right?)
Is it either or /bash or /sh ? Or, preferably /sh, unless you know its going to be /bash, then there's some benefit to having /bash? Which is more popular; or should I just check every script I run and remember what machine I am on, i.e. what shell I'm using? Cuz I switch machines sometimes; it gets confusing for newbies?
Thanks Greg,
#Sh@z@m!
exit
-
If you are writing scripts only for TCL, use sh. "sh" means the default shell in the Linux System. For TCL, it is "ash" https://linux.die.net/man/1/ash
For may GNU/Linux distros, it is "bash" https://linux.die.net/man/1/bash
Bash has more features like arrays than ash. Moreover, bash can be easily found in any distro. So, cross-distro scripts are to be created in bash (my opinion).
If you are switching distros, use bash. But I personally recommend sh or ash on TCL and my infocreator script work is based on ash of TCL.
If anyone is interested in this thread, see this : https://wiki.manjaro.org/index.php/Manjaro_Hardware_Detection_Overview .
It is an implementation of this thread in Manjaro Linux. I know nothing about C or C++ so if anyone knows them, you can see here.
-
philosophical approach
There are 2 types of linux distributions.
first one; turnkey all-in-one (including redundant drives)
the second; do it yourself linux
common feature of both
their inability to respond to realistic needs on time and instantly.
not everyone can create linux themselves.
usually turns to turnkey model.
therefore, loss of time and efficiency is inevitable.
The whole linux configuration I have created in my mind is actually about my process of finding and discovering the right file in the repository archive.
Installing the drivers before the software the user will deal with is one of the top priorities and one of the most blindly tedious operations.
the hardware id is already communicating with the motherboard bios all the time.
communicates over this identification number. this is already the most basic drive format. and naturally this hardware is its own DNA structure.
hardware already provides the most basic communication at the bios level.
the opening purpose of this topic; with minimalist approaches
The thought of creating a minimalist linux experience where less trouble to the end user or even a hassle-free!
minimalist linux distributions are often an experience-based usage. Of course, getting to this point is for me;
After at least 10 different Linux distributions,
and if you pay attention to my forum membership date,
After 10 years, I could tell the big difference TCL between other linux.
The essence of the event is briefly;
bios data is literally a fixed id that is accessible
it needs a hard drive.
For this, the correct file needs to be downloaded from the repository.
doing this manually takes experience. even if it's simple
how can this be automated.
define the variable constant and download the required software.
-
the upper text; It was translated to English with google translation.
-
I wrote the previous comment a little hurriedly.
Google Translate ; again misinterpreted long sentences! but the main idea is clear!
hardware can be variable.
however, each of them has a fixed and unchangeable id id.
No driver is required to read hardware IDs.
if you fully understand what I am trying to explain here.
Without adding garbage files that will never be used in the system,
a smaller, more minimalist linux distribution might emerge.
also, the end user will not need to search for drivers.
especially new users.
-
Seeing "chmod 777" raises alarm bells to me!!
Oh yeah. Don't do that. ( I knew this, but not how fatal it is).
https://superuser.com/questions/300743/sudo-chmod-r-777
I think I am OK because I didn't use the -r , recursive, function (I read something once about sticky bits "bricking" a raspeberyy pi; I hope I didn't do that?). But I will change my code. Why did I do it in the first place? I think the piCore wouldn't let me mkdir in root? Maybe I'll just change the U to 7 and leave the G and O alone?
(People out there, reading this; listen to Greg and others. Not me. Unless I said something smart about biology or philosophy or the history of science. Then listen to me.)
*Edit* Maybe, $ chmod 7GO , and then, at the end of the script, $ chmod UGO ; where UGO are the original settings for root on a picore OS. Yeah, that's much better.
-
:)
concretization efforts;
http://forum.tinycorelinux.net/index.php/topic,24445.0.html