U:\kern

From SpareMiNT Wiki

Jump to: navigation, search

kernfs aka kernel filesystem is the /kern directory. It was added in FreeMiNT 1.15.5 mainly as an expanded replacement for /proc.

Folders inside the /kern provide extended information about separate processes, with /kern/self being special. Files present in the /kern directory contain global information about the system. These are:


Contents

[edit] /kern/buildinfo

This file provides information about the compiler, options and flags which were used to compile the kernel.

Examples:

CC: gcc version 2.95.2 19991024 (release)
CFLAGS: -mshort -m68030 -O2 -fomit-frame-pointer
CDEFS: -DMULTITOS -DVERBOSE_BOOT -DTRAPS_PRIVATE -DCRYPTO_CODE
       -DBOOT_MENU -DONLY030 -DCPU030
CC: gcc version 2.95.3 20010315 (release)
CFLAGS: -mshort -g -m68020-60 -O2 -fomit-frame-pointer
CDEFS: -D__KERNEL__ -DLANG_ENGLISH -DSYSCALL_REENTRANT -DVERBOSE_BOOT -DCRYPTO_CODE -DSOFT_UNITABLE -DBUILTIN_SHELL -DARANYM -DM68040 -DDEBUG_INFO
CC: gcc version 4.5.2 (Gentoo 4.5.2 p1.0, pie-0.4.5)
CFLAGS: -mshort -g -m68020-60 -O2 -fomit-frame-pointer
CDEFS: -D__KERNEL__ -DLANG_ENGLISH -DSOFT_UNITABLE -DARANYM -DDEBUG_INFO -DM68040 -DWITH_HOSTFS -DBOOTSTRAPABLE -DC_ONLY
CC: gcc version 4.5.3 (MiNT 20110429) (GCC)
CFLAGS: -m68000 -Werror -mshort -g -O2 -fomit-frame-pointer
CDEFS: -D__KERNEL__ -DLANG_ENGLISH -DVERBOSE_BOOT -DWITH_SINGLE_TASK_SUPPORT -DM68000 -DNO_RAMFS -DNO_FAKE_SUPER

[edit] /kern/cookiejar

The cookie jar slots listed in the order they have been installed, for example:

Falcon030: ARAnyM:
# Slots available: 1024
# Slots used:        20
0x5F435055 (_CPU): 0x0000001E
0x5F465055 (_FPU): 0x00060000
0x5F56444F (_VDO): 0x00030000
0x5F4D4348 (_MCH): 0x00030000
0x5F535749 (_SWI): 0x000000BF
0x5F534E44 (_SND): 0x0000001F
0x5F464443 (_FDC): 0x01415443
0x5F414B50 (_AKP): 0x00000001
0x5F494454 (_IDT): 0x0000112D
0x53435349 (SCSI): 0x00164D58
0x55534844 (USHD): 0x0000FBFA
0x58484449 (XHDI): 0x0016124C
0x4E564449 (NVDI): 0x00076D1C
0x46534D43 (FSMC): 0x0005E1F4
0x4D694E54 (MiNT): 0x0000010F
0x5F464C4B (_FLK): 0x00000000
0x504D4D55 (PMMU): 0x00000000
0x6E414553 (nAES): 0x002EA000
0x45644449 (EdDI): 0x0005EEE6
0x44485354 (DHST): 0x00000006
# Slots available: 1024
# Slots used:        24
0x5F435055 (_CPU): 0x00000028
0x5F465055 (_FPU): 0x00080000
0x5F56444F (_VDO): 0x00030000
0x5F4D4348 (_MCH): 0x00050000
0x5F534E44 (_SND): 0x00000027
0x5F465242 (_FRB): 0x0002533C
0x5F494454 (_IDT): 0x0000112E
0x5F464443 (_FDC): 0x00415443
0x58484449 (XHDI): 0x0009B1F2
0x5F49534F (_ISO): 0x00000000
0x4D694E54 (MiNT): 0x00000112
0x5F464C4B (_FLK): 0x00000100
0x5F414B50 (_AKP): 0x00000000
0x5354694B (STiK): 0x010229C4
0x4D67536E (MgSn): 0x0105B9C2
0x4D63536E (McSn): 0x0105B952
0x47535842 (GSXB): 0x00000000
0x5F4A5044 (_JPD): 0x01162C60
0x45644449 (EdDI): 0x011645D0
0x46534D43 (FSMC): 0x0106A01C
0x4E564449 (NVDI): 0x0106A024
0x44435344 (DCSD): 0x0106A02C
0x66564449 (fVDI): 0x0106A00C
0x6E414553 (nAES): 0x01096000

Each line, except the first two, contains the cookie jar tag in hexadecimal, then the same value in ASCII, and then the entry value in hex, respectively.


[edit] /kern/cpuinfo

Here the basic information about the CPU is provided, it may look like this :

Falcon030 example: ARAnyM example: Mega STE example:
CPU:        68030
MMU:        68030
FPU:        68882
Clockspeed: 16 MHz
BogoMips:   3.96
CPU:		68040
MMU:		68040
FPU:		68040
Clocking:	121.0MHz
BogoMIPS:	80.69
Calibration:	40345600 loops
CPU:		68000
MMU:		none
FPU:		none
Clocking:	8.0MHz
BogoMIPS:	0.83
Calibration:	415000 loops

The BogoMIPS field contains an approximate information about the CPU speed measured in million instructions per second.

[edit] /kern/filesystems

This is a list of installed file systems (ie. including drives) mounted on u: (/). Unlike Linux, most of these will not be present in /etc/fstab when using a fill distribution. It may look like this:

EasyMiNT example: ARAnyM example:
        Minix-FS
        hostfs-xfs
        unknown
        unknown
        ext2-xfs
nodev   kern pseudo file-system
nodev   shm pseudo file-system
        ram-xfs
nodev   proc pseudo file-system
nodev   pipe pseudo file-system
nodev   bios pseudo file-system
        vfat-xfs
        unknown
        unknown
        unknown
        unknown
        unknown
nodev   kern pseudo file-system
nodev   shm pseudo file-system
        unknown
nodev   proc pseudo file-system
nodev   pipe pseudo file-system
nodev   bios pseudo file-system
        hostfs-xfs
        unknown

Here unknown is usually a host OS folder mapped as a drive letter.


[edit] /kern/hz

The system timer resolution in ticks per second. It may look like this:

200


[edit] /kern/loadavg

This is the current load average information. The first three numbers provide the information about the average system load last 1, 5 and 15 minutes respectively. The fourth one, presented as a fraction, is the number of the currently running processes relative to the total number of processes, e.g. 4/25 means, that four processes are running, out of 25 total. This is continuously changing as processes are scheduled. The last number currently always equals 0.

Example contents:

0.000 0.000 0.000 2/14 0


[edit] /kern/memdebug

May not be present on every MiNT setup. It provides a list of memory allocations useful for debugging purposes. It may look similar to the following extract:

Example contents:

core memory dump: starting at region 12A4C8
     8192 bytes at   13C000: next   12A5A0 [0 links, mflags    2]
     8192 bytes at   13E000: next   12A5C4 [0 links, mflags    2]
 13205504 bytes at   140000: next   12A510 [0 links, mflags    0]
     8192 bytes at   DD8000: next        0 [0 links, mflags    1]
 
alt memory dump: starting at region 12A4EC
     8192 bytes at  1000000: next   12AAB0 [0 links, mflags    1]
     8192 bytes at  1002000: next   12AAF8 [0 links, mflags    1]
   212992 bytes at  1004000: next   12AB40 [0 links, mflags    1]
     8192 bytes at  1038000: next   12AA20 [0 links, mflags    1]
     8192 bytes at  103A000: next   12AA8C [0 links, mflags    1]
   106496 bytes at  103C000: next   12AAD4 [0 links, mflags    1]
     8192 bytes at  1056000: next   12A9B4 [0 links, mflags    1]
    32768 bytes at  1058000: next   12AB64 [0 links, mflags    1]
     8192 bytes at  1060000: next   12A9FC [0 links, mflags    1]
     8192 bytes at  1062000: next   12ABAC [0 links, mflags    1]
...


[edit] /kern/meminfo

Presents a readable summary of memory information.

MiNT example: Linux example:
	  total:  	  used:   	  free:
Mem:	 147447808	   9830400	 137617408
Swap:	         0	         0	         0
 
MemTotal:	 143992 kB
MemFree:	 134392 kB
FastTotal:	 131072 kB
FastFree:	 121496 kB
CoreTotal:	  12920 kB
CoreFree:	  12896 kB
MemTotal:         476492 kB
MemFree:            5932 kB
Buffers:            2076 kB
Cached:            76208 kB
SwapCached:        40140 kB
Active:           172680 kB
Inactive:         164352 kB
Active(anon):     138700 kB
Inactive(anon):   139072 kB
Active(file):      33980 kB
Inactive(file):    25280 kB
Unevictable:           0 kB
Mlocked:               0 kB
HighTotal:             0 kB
HighFree:              0 kB
LowTotal:         476492 kB
LowFree:            5932 kB
SwapTotal:       2096440 kB
SwapFree:        1810008 kB
Dirty:               132 kB
Writeback:             0 kB
AnonPages:        247160 kB
Mapped:           109408 kB
Shmem:             19020 kB
Slab:              18620 kB
SReclaimable:       7484 kB
SUnreclaim:        11136 kB
KernelStack:        3704 kB
PageTables:         8988 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     2334684 kB
Committed_AS:    2883768 kB
VmallocTotal:     541240 kB
VmallocUsed:       33280 kB
VmallocChunk:     503072 kB
HardwareCorrupted:     0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       42432 kB
DirectMap2M:      448512 kB


[edit] /kern/stat

Similar to /proc/stat on Linux, this currently only contains the kernel status for the CPU.

Example contents:

cpu 	      905         0     13855     46691


[edit] /kern/sysdir

This is the pathname to the FreeMiNT system directory, either u:/c/mint/ or the path to the current MiNT version, eg. u:/c/mint/1-18-cur/.

Example contents:

u:/c/mint/1-17-0/


[edit] /kern/time

Here is the information about the kernel time, i.e. the number of seconds since January the 1st 1970, and the same number with timezone value subtracted.

Example contents:

1314263998.995000 1314263998.995000


[edit] /kern/uptime

The system uptime in minutes, and the total idling time in seconds.

Example contents:

5.9386 259.950


[edit] /kern/version

The system name, version number and compile time. Most of this information is also presented with the console command uname -a (if available).

Examples:

FreeMiNT version 1.16 (roo@pissnelke.apo.lan) (gcc version 2.95.3 20010315 (release)) #1 Wed Mar 29 18:22:15 Local time zone must be set--see zic manual page 2006
FreeMiNT version 1.18 (Bill.Gates@server.(none)) (gcc version 4.5.2 (Gentoo 4.5.2 p1.0, pie-0.4.5)) #1 Wed Aug 10 01:16:06 BST 2011


[edit] /kern/welcome

The system welcome messages displayed at bootup. I contains control sequences that provide some control over the presentation of the text (in order shown below: clear line, inverse colors, normal colors).

Example contents:

�v
�p This is FreeMiNT v1.18.0-ALPHA        �q
compiled Aug 10 2011
 
FreeMiNT is a modified version of MiNT
 
MiNT © 1990,1991,1992 Eric R. Smith
MultiTOS kernel
     © 1992,1993,1994 Atari Corporation
All Rights Reserved.
�p  Use this program at your own risk!  �q
 
�p             *** WARNING ***              �q
You have turned off the memory protection.
This is not recommended and may not be
supported in the future.


[edit] Not Implimented Yet

The following are not yet implemented.


  • /kern/devices - list of all character devices and block devices in order of device number

Linux example:

Character devices:
  1 mem
  4 /dev/vc/0
  4 tty
  4 ttyS
  5 /dev/tty
  5 /dev/console
  5 /dev/ptmx
  7 vcs
 10 misc
 13 input
 14 sound
 21 sg
 29 fb
 81 video4linux
 99 ppdev
116 alsa
128 ptm
136 pts
171 ieee1394
180 usb
189 usb_device
226 drm
250 ati
251 hidraw
252 firewire
253 bsg
254 rtc
 
Block devices:
  1 ramdisk
  2 fd
259 blkext
  8 sd
  9 md
 11 sr
 65 sd
 66 sd
 67 sd
 68 sd
 69 sd
 70 sd
 71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
179 mmc
253 device-mapper
254 mdp


  • /kern/dma - list of devices using dma (direct memory access) hardware

Linux example:

 2: floppy
 3: parport0
 4: cascade


[edit] /kern/self

This a special folder referring to the current process being run (self). It contains much information available elsewhere in a MiNT setup, like process ID, etc. but it also contains the full path of the command being run, the environment variables at start time, and other information specific to the process. The examples below were produced by cat and that various files in /kern/self/*.

Example contents:

/kern/self/cmdline: (command line - 138 chars max)
 U:/bin/cat /kern/self/meminfo > /g/self/meminfo.txt
 
/kern/self/cwd: (directory - current working directory)
 {will take you to /g/self in this case}
 
/kern/self/environ: (\M seperated list of enviroment vars at startup)
PWD=/g/self
UNIXMODE=/brUs
PCONVERT=PATH,HOME,SHELL
GEMEXT=PRG,APP,GTP,OVL,SYS
SYSDIR=u:/c/mint/1-16-cur/
TOSRUN=u:\opt\toswin2\tw-call.prg
ACCPATH=c:\_\ACC ACCEXT=ACC,ACX
AVSERVER=DESKTOP 
LINES=24
SLBPATH=u:/c/mint/1-16-cur/
SHLVL=1
COLUMNS=80
SDL_VIDEODRIVER=gem
TOSEXT=TOS,TTP
FONTSELECT=DESKTOP 
TERM=tw100
PATH=u:\bin,u:\usr\bin,u:\usr\sbin,u:\sbin,u:\boot\mint\bin,u:\c\xaaes
_=/bin/cat
OLDPWD=/d/opt/toswin2
 
/kern/self/exe: (the actual binary being run)
 {binary data}
 
/kern/self/fd: (file descriptors)
 {currently being used by the process}
 
/kern/self/fname: (the full path and filename)
 U:/bin/cat
 
/kern/self/mem: (the memory)
 "Not yet implemented!"
 
/kern/self/meminfo: (the memory information for the process)
01646000-01648001   1 -----a 00000000 00:00 0
01736000-01758001   1 -----a 00000000 00:00 0
0160C000-0160E001   1 -----a 00000000 00:00 0
 
/kern/self/root: (the home path of the user running the binary)
 {will take you to the /root in this case}
 
/kern/self/stat: (same as for /proc/?/stat - task managers look at these)
85 (cat) R 64 85 85 85 7 0 0 0 0 20 10 0 0 0 0 0 3439562 3439562 94294 155648 155648 2147483647 24338688 24477696 27692 0 0 0 0 0 0 0
 
/kern/self/statm: (same as for /proc/?/statm)
19 19 0 12 0 6 0
 
/kern/self/status: (same as for /proc/?/status - human readable version of stat)
Name:	cat
State:	R (running)
Pid:	87
PPid:	64
Uid:	0	0	0
Gid:	0	0	0
VmSize:	     152 kB
VmCore:	       0 kB
VmAlt:	     152 kB
VmSwap:	       0 kB
VmKer:	       0 kB
NumReg:	      64 
ShTxt:	       0 kB
ShTxtT:	       0 kB
Fsav:	       0 kB
Shared:	       0 kB
Keep:	       0 kB
KMall:	       0 kB
SigPnd:	00000000
SigBlk:	00000000
SigIgn:	00000000
SigCgt:	00000000
Personal tools
Resources