Thursday, September 12, 2019

Linux kernel 2.4.37.11 rebuild on 486 (1)

Download and config

Lets rebuild Linux kernel on 486.

Made directory at
mkdir /usr/src/linux-2.4.37.11
cd /usr/src/linux-2.4.37.11
Downloaded tgz file into that directory over a network.
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v2.4/linux-2.4.37.11.tar.gz df -h 
Be sure that there is enogh free space. 170MB is needed.

tar -xzf linux-2.4.37.11.tar.gz
make menuconfig

edit your conf

make dep
make clean
make bzImage
make modules
Install modules to temp, will copy later to right place.

make modules_install INSTALL_MOD_PATH=/tmp/linux 

Wednesday, September 4, 2019

X Window System (1)

X11R7

So X11 latest version is X11R7.7. Downloaded and cant find S3 ViRGE drivers. Hmmm.
https://www.x.org/releases/X11R7.7/doc/xorg-docs/ReleaseNotes.html
Removed in this Release section reveals that in this release its removed. :(

Previous version has it:
https://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html
Can we add it back?

Build script: https://cgit.freedesktop.org/xorg/util/modular/tree/?h=X11R7.6

Well, looking at the source its hell to compile.
More updated version in gitlab https://gitlab.freedesktop.org/xorg

Xfree86

I currently have Xfree86.
XFree86 Version 4.2.1 / X Window System
(protocol Version 11, revision 0, vendor release 6600)
Release Date: 3 September 2002
Latest version is:
XFree86 Version 4.8.0
Release Date: 15 December 2008
X Protocol Version 11, Revision 0
And its really easy to compile. New host.def and some changes in xfree.cf
make World
And done. Like what? :D

Still, my new video card S3 ViRGE  i bought so i can use hw accelerated yuv for Mpleyer has some problems.

Mplayer Xv req
http://www.mplayerhq.hu/DOCS/HTML/en/xv.html
It must support YUY2 packed, and YV12 planar pixel formats to be usable with MPlayer.

In S3 driver there is.
s3v_xv.c
/* Looks like ViRGE only supports YUY2 and Y211?, */
Hardware manual (link 10MB)

I need to compile X server, and Mplayer again to see if it all actually works.

Building it


States that XFree86-4.8.0-src-7.tgz has hardcopy of documents, so i will not need it.
Made directory at

mkdir /usr/src/XFree86
cd /usr/src/XFree86
Downloaded tgz files into that directory over a network.
wget ftp://ftp.xfree86.org/pub/XFree86/4.8.0/source/XFree86-4.8.0-src-1.tgz
wget ftp://ftp.xfree86.org/pub/XFree86/4.8.0/source/XFree86-4.8.0-src-2.tgz
wget ftp://ftp.xfree86.org/pub/XFree86/4.8.0/source/XFree86-4.8.0-src-3.tgz
wget ftp://ftp.xfree86.org/pub/XFree86/4.8.0/source/XFree86-4.8.0-src-4.tgz
wget ftp://ftp.xfree86.org/pub/XFree86/4.8.0/source/XFree86-4.8.0-src-5.tgz
wget ftp://ftp.xfree86.org/pub/XFree86/4.8.0/source/XFree86-4.8.0-src-6.tgz
df -h 
Be sure that there is enogh free space. 280 MB is needed.
Exctract and make preparations.

tar -xzf XFree86-4.8.0-src-1.tgz
tar -xzf XFree86-4.8.0-src-2.tgz
tar -xzf XFree86-4.8.0-src-3.tgz
tar -xzf XFree86-4.8.0-src-4.tgz
tar -xzf XFree86-4.8.0-src-5.tgz
tar -xzf XFree86-4.8.0-src-6.tgz
mkdir build
cd build
lndir ../xc
Last line is to make a shadow directory of symbolic links. So all new files will not be in source tree.
Made a new host.def and some changes in xfree86.cf in xc/config/cf. So it has what i need.

Monday, September 2, 2019

GCC 3.4.6 build

GCC 3.4.6 

My 486 system has old compiler, version 3.3.4.
To bring it sort of up to date i need to compile newer version.

Using only c,c++,obj-c parts of it.

Build script and package creation is done by script witch is based on slackware (11.0) source files.

Compile is done on 486.

First build

Changed config script so no ada, fortran java. 
--enable-languages=c,c++,objc

10 hours later it failed.  :D
This error was not dominant but present:
gcc: Internal error: Terminated (program cc1)
https://stackoverflow.com/questions/30887143/make-j-8-g-internal-compiler-error-killed-program-cc1plus

dmesg
Out of Memory: Killed process 14779 (cc1).Out of Memory: Killed process 14779 (cc1).Out of Memory: Killed process 15487 (sh).Out of Memory: Killed process 15487 (sh).Out of Memory: Killed process 16049 (cc1).Out of Memory: Killed process 16049 (cc1).Out of Memory: Killed process 15488 (genattrtab).Out of Memory: Killed process 15488 (genattrtab).Out of Memory: Killed process 16202 (cc1).Out of Memory: Killed process 16202 (cc1).Out of Memory: Killed process 16071 (make).Out of Memory: Killed process 16071 (make).Out of Memory: Killed process 16977 (cc1).Out of Memory: Killed process 16977 (cc1).Out of Memory: Killed process 16207 (make).Out of Memory: Killed process 16207 (make).
Adding more swap it seems is needed. Lets hope so.

Created a zero-filled regular file of 16M and turned it on (until restart):
dd if=/dev/zero of=/.swapfile bs=16 count=1M
mkswap /.swapfile
swapon /.swapfile
swapon -s

To disable swap if needed:
swapoff /.swapfile
Removed objc also. And removed j 2 from make comand. :D

Compile started again.

9 hours later fail again. Killed it.
cc1: out of memory allocating 9867200 bytes after a total of 7585952 bytes
dd if=/dev/zero of=/.swapfile bs=32 count=1M
Try again.

Finaly done.

Compile time: 1 day 11 hours.
Memory usage: 16 MB RAM+64MB swap (minimum swap free was 11MB by top)

Install


installpkg gcc-3.4.6-i486-1.tgz
installpkg gcc-g++-3.4.6-i486-1.tgz


Saturday, August 31, 2019

Lilo

The change

I have two hard disks. First (primary master) is original Windows 95 drive.
Second disk (primary slave) is added drive with linux installed.

So to boot linux i have to boot to dos and load linux from a command line.

But how can i had boot manager?

Adding Lilo

Well, i compiled lilo-24.2  (https://www.joonet.de/lilo/ftp/sources/) on my virtual machine. Copyed files over to 486 PC.
Made configuration file changes in /etc/lilo.conf
So that lilo boot is installed on windows 95 drive and second stage is booted from linux drive.

Got warning: "sector and map file are on different disks"
And when booting up got:  "timestamp mismatch"

What the hell.

Now i have unbootable machine.
Still i was in luck, as i made floppy drive that had grub and Freedos. I was able to fix windows 95 disk mbr and got to boot again linux from there.

Still after many tries i was still on the same errors.

Finaly i was thinking, maybe if i change the order of disks i can get rid of first warning.
Ok booting from floppy and i get no root file system error and kernel panic. Requesting me to check filesystem in readonly mode. What? Cant change any config files.

Realized that /etc/fstab has wrong info info about drives. hdb was now hda, drive where linux is at.

Ok
Booted again from windows drive. I had version where initrd file was present so i can mount hda and change /etc/fstab file. Done. Booted.
Still second error.

God deem.

Made lots of changes, but still no luck.

Sugest to uninstall lilo like lilo -U and reinstall then with lilo -v
No luck.

Finaly. Downloaded source code to 486 PC and made make.
Complains that gcc must be 3.3.5, i have 3.3.4 (checkit file). Made version lower in config file. Hit make again. After a while when it was done i hit:
make install
Then:
lilo -M /dev/hda MBR
lilo -v
Rebooted and got Lilo boot screen.

:D

Final config file:
# LILO configuration file
boot = /dev/hda
message = /boot/boot_message.txt
prompt
timeout = 1200
change-rules
  reset
vga = normal
map = /boot/map
other = /dev/hdc
  label = win
image = /boot/vmlinuz-2.4.37.11
  root = /dev/hda1
  label = Linux-2.4.37.11
  read-only
image = /boot/vmlinuz-ide-2.4.29
  root = /dev/hda1
  label = Linux-2.4.29
  read-only

Edit:


Back to Linux

Linux 2.4.37.11

Managed to compile Linux kernel 2.4.37.11 and upload it to 486 PC.
Tested some things and one is lynx, for fun.


Show cpuinfo.

Sunday, October 29, 2017

Update on Mplayer 1.3.0

Configuration


New configuration:
./configure --yasm='' --target=i486-Linux --disable-ftp --disable-tv-v4l1 --disable-tv --disable-qtx --disable-real --disable-win32dll --disable-gif --disable-mmx   --disable-3dnow   --disable-sse --disable-sse2 --disable-sse3 --disable-fastmemcpy --disable-xanim --disable-vm --disable-vesa --disable-svga --disable-xv  --disable-jpeg --disable-gl --disable-mga --disable-sdl --disable-fbdev  --disable-caca --disable-aa --disable-dga1 --disable-dga2 --disable-tga --disable-md5sum --disable-pnm --disable-mng --disable-libvorbis --disable-esd --enable-libmpeg2-internal --enable-libmpeg2 --disable-decoder=mlp --disable-mencoder --disable-freetype --disable-ass --disable-postproc --disable-unrarexec --disable-vidix --disable-vidix-pcidb   --disable-encoder=mlp  --disable-parser=mlp  --disable-protocol=mlp  --disable-demuxer=mlp  --disable-muxer=mlp --disable-yuv4mpeg     --disable-cmov  --disable-fast-clz --disable-fast-cmov --disable-mtrr
Manually disabled xmm clobbers inf configuration.
MPEG12_POSTPROC set to 0


Profiling

--enable-profile will not work if HAVE_INLINE_ASM is defined 1. Fails on cabarc.c Complains about missing reg (ebx ?).
No link time -pg option added. Did this manually. Results below.

Tested with sample mp4 file:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
 17.98     11.11    11.11  3754368     0.00     0.00  idctSparseColPut_8
 16.64     21.39    10.28     4880     2.11     2.11  yuv2rgb_c_16_ordered_dither
  5.21     24.61     3.22  4386304     0.00     0.00  idctRowCondDC_8
  4.79     27.57     2.96   631936     0.00     0.00  idctSparseColAdd_8
  4.78     30.52     2.95   247680     0.01     0.13  ff_mpv_decode_mb
  3.93     32.95     2.43   247680     0.01     0.04  mpeg4_decode_mb
  3.25     34.96     2.01   956568     0.00     0.01  mpeg4_decode_block
  2.28     36.37     1.41   469296     0.00     0.00  dct_unquantize_h263_intra_c
  2.27     37.77     1.40   469296     0.00     0.00  ff_mpeg4_pred_ac
  2.14     39.09     1.32   469296     0.00     0.03  ff_simple_idct_put_8
  2.04     40.35     1.26   469296     0.00     0.00  ff_mpeg4_pred_dc
  2.01     41.59     1.24   183189     0.01     0.04  mpeg_motion
  1.85     42.73     1.14   234889     0.00     0.00  put_pixels8_8_c
  1.62     43.73     1.00    67500     0.01     0.01  put_pixels16_8_c
  1.46     44.63     0.90   469296     0.00     0.00  mpeg4_decode_dc
  1.44     45.52     0.89    52464     0.02     0.02  put_no_rnd_pixels8_xy2_8_c
  1.36     46.36     0.84     1376     0.61    39.72  decode_slice
  1.34     47.19     0.83   188391     0.00     0.04  ff_mpv_motion
  1.33     48.01     0.82    45901     0.02     0.02  put_pixels8_xy2_8_c
  1.32     48.83     0.82    49058     0.02     0.02  put_no_rnd_pixels16_8_c
  1.07     49.49     0.66   201780     0.00     0.00  ff_h263_update_motion_val
  0.96     50.08     0.60   161800     0.00     0.00  ff_h263_decode_motion
  0.79     50.57     0.49    53937     0.01     0.01  ff_clean_intra_table_entries
  0.76     51.04     0.47   247680     0.00     0.00  mpeg4_is_resync
  0.60     51.41     0.37    13688     0.03     0.03  avg_pixels16_8_c
  0.58     51.77     0.36     1105     0.33     0.33  copy
  0.57     52.12     0.35     7020     0.05     0.06  mp_msg_va
  0.49     52.43     0.31    33014     0.01     0.01  put_pixels8_l2_8
  0.47     52.72     0.29    78992     0.00     0.05  ff_simple_idct_add_8
  0.42     52.98     0.26  1016784     0.00     0.00  add_dct
  0.42     53.24     0.26    13440     0.02     0.02  ff_init_scantable
  0.40     53.49     0.25    33188     0.01     0.01  put_no_rnd_pixels8_l2_8
  0.40     53.74     0.25     3359     0.07     0.18  decode_vop_header

Mplayer 1.3.0 and new dev PC

New dev pc


My pentium 3 had some problems with ext2 filesystem. fsck was forced and it made kernel into panic mode. Used Linux Mint 12 cd to fix this but on next reboot same story. Shit happens. So filesystem was dead.
Installed Slackware 10.1 to virtualbox vm. Recompiled kernel, mpg123 and x86free for s3 (need to make post about this).

Configuration of Mplayer


In last post i used Mplayer version 0.90. It is old :D. So i downloaded version 1.3.0.
I used command line to configure it:
./configure --yasm='' --target=i486-Linux --disable-ftp --disable-tv-v4l1 --disable-tv --disable-qtx --disable-real --disable-win32dll --disable-gif --disable-mmx   --disable-3dnow   --disable-sse --disable-sse2 --disable-sse3 --disable-fastmemcpy --disable-xanim --disable-vm --disable-vesa --disable-svga --disable-xv  --disable-jpeg --disable-gl --disable-mga --disable-sdl --disable-fbdev  --disable-caca --disable-aa --disable-dga1 --disable-dga2 --disable-tga --disable-md5sum --disable-pnm --disable-mng --disable-libvorbis --disable-esd --enable-libmpeg2-internal --enable-libmpeg2 --disable-decoder=mlp --disable-mencoder --disable-freetype --disable-ass --disable-postproc --disable-unrarexec --disable-vidix --disable-vidix-pcidb   --disable-encoder=mlp  --disable-parser=mlp  --disable-protocol=mlp  --disable-demuxer=mlp  --disable-muxer=mlp
  
This is all well and good, but there are problems on config.h and other palces:

  • cmov enabled
  • i686 enabled 
  • gcc native enabled (i have old compiler so it will fail, atomic)
  • make is version 3.80 (needs version 3.82) or there will be error make: *** virtual memory exhausted. Stop.  (http://ppcluddite.blogspot.com/2011/11/) (https://ftp.gnu.org/gnu/make/)
  • atomic.c is not compiled (needs manual makefile change)
  • need to disable hwaccel drivers in allcodes.c
  • unsupported -Werror=format-security option in configure for cc. Configuration fails.


If all these changes are made, it compiles and works.
Compiled file  v0.90 2.5MB vs 12MB v1.3.0

At least it plays videos. :D

To test i made some sample files using Shotcut. mp4 file mpeg4 codec QVBR 41% mp3 16000Hz 16kb/s.

./mplayer -af channels=1 -framedrop testfile.mp4