ghaerr / elks Goto Github PK
View Code? Open in Web Editor NEWEmbeddable Linux Kernel Subset - Linux for 8086
License: Other
Embeddable Linux Kernel Subset - Linux for 8086
License: Other
Here is the output:
00427 if ip_vjhc_compress.off=0
***** relocation impossible..............................................^
00438 if ip_vjhc_compress.off=0
***** relocation impossible..............................................^
00469 if ip_vjhc_compress.off=0
***** relocation impossible..............................................^
00003 errors
00000 warnings
../Make.defs:122: recipe for target 'vjhc.o' failed
Trying to build elksnet results in the following:
root@kubuntu:/usr/src/elks/elksnet# make
make[1]: Entering directory '/usr/src/elks/elksnet/ktcp'
bcc -ansi -O -0 -D__KERNEL__ -I/usr/src/elks/elks/include -c -o ktcp.o ktcp.c
bcc -ansi -O -0 -D__KERNEL__ -I/usr/src/elks/elks/include -c -o slip.o slip.c
bcc -ansi -O -0 -D__KERNEL__ -I/usr/src/elks/elks/include -c -o ip.o ip.c
bcc -ansi -O -0 -D__KERNEL__ -I/usr/src/elks/elks/include -c -o icmp.o icmp.c
bcc -ansi -O -0 -D__KERNEL__ -I/usr/src/elks/elks/include -c -o tcp.o tcp.c
bcc -ansi -O -0 -D__KERNEL__ -I/usr/src/elks/elks/include -c -o tcp_cb.o tcp_cb.c
bcc -ansi -O -0 -D__KERNEL__ -I/usr/src/elks/elks/include -c -o tcp_output.o tcp_output.c
bcc -ansi -O -0 -D__KERNEL__ -I/usr/src/elks/elks/include -c -o timer.o timer.c
bcc -ansi -O -0 -D__KERNEL__ -I/usr/src/elks/elks/include -c -o tcpdev.o tcpdev.c
bcc -ansi -O -0 -D__KERNEL__ -I/usr/src/elks/elks/include -c -o netconf.o netconf.c
bcc -ansi -O -0 -D__KERNEL__ -I/usr/src/elks/elks/include -c -o vjhc.o vjhc.c
vjhc.c:117.19: error: need ')'
vjhc.c:119.1: error: need ';'
vjhc.c:119.1: error: need variable name
vjhc.c:117.3: error: need ';'
vjhc.c:117.21: error: ip_vjhc_compress already declared
vjhc.c:118.12: error: pkt already declared
vjhc.c:120.1: error: need variable name
vjhc.c:121.8: error: need ';'
vjhc.c:130.3: error: need variable name
vjhc.c:130.5: error: need ';'
...and hundreds of follow-up errors. Probably related to the funny-looking DEFUN macro (why is that needed anyway?)
[12:43:40][~/p/elks]
[sparky4@lappy4]$ sudo ./build.sh
-e
WARNING: Disk images can only be built if you have root permissions
./build.sh: 38: ./build.sh: pushd: not found
./build.sh: 39: .: Can't open ./env.sh
Make a file, rm
that file, and you'll get the message "rm: could not remove foo"
I was trying to compile elks and get networking running with the full3 image, but I was not able to crash because there was an error about a double free which crashed completely. I narrowed down the issue to elks/arch/i86/mm/malloc.c in commit 4786296
I am not familiar enough with the internals of malloc to fix the problem myself, as some of the optimizations look like they could be helpful when specific conditions are met.
When deselecting MINIXFS in ELKS configuration, the build fails on:
undefined symbol: _block_write
undefined symbol: _block_read
Looks like to be linked with PR jbruchon#163.
When using BIOS console I/O, the system softhangs on input of a char < (ascii)6 (such as ctrl-C). The problem goes away when the cmp al,#6 instruction in kbd_timer() is removed. (bioscon.c)
What about adding a feedback in the configuration & build script ? Activated after the explicit consent of the user, it would upload some anonymous data to one of our server, like the ELKS configuration, in order to help us to figure out what is the real usage of the product and where we should focus our effort ?
My XT has an XTIDE card in it and when elks trys to look for a HDD, it crashes.... ><
I am reporting this issue and i can also provide screen photos of the crash. ^^;
http://4ch.mooo.com/4/xtssd/ the card i have is this
To test the ELKS telnet client, I connect to my Linux workstation that is configured in UTF-8 for almost everything. The telnet server is the Busybox applet sudo busybox telnetd -F
. I don't know at this stage where the wrong thing is (client ? server ? failed negociation ?), but the result is uggly.
While testing the fix to the select()
weakness (see #208), I can observe a problem that looks closely linked to the one reported by @Mellvik in issue #133 about the console management.
I am using busybox telnet 127.0.0.1 2323
on the host and QEMU for ELKS target, with only ktcp
and telnetd
daemons. Sometimes part of the output of the remote command is directed to the ELKS console in QEMU, and not to the remote telnet client, even if not logged in !
In remote telnet client:
mfld@home /home/mfld/elks $ busybox telnet 127.0.0.1 2323
Welcome to the ELKS telnet server
login: root
# cd /bin
#
# ls -l
-xr-x 1 root root 8396 May 13 2018 banner
-rwxr-xr-x 1 root root 648 May 13 2018 basename
And in local console (in QEMU):
ELKS 0.2.0
login: Telnetserver:accept connection
Commands entered by remote terminal:
># cd /bin
>ls -l
>-rwxr-xr-x 1 root root 50652 May 13 2018 ash
-rwxr>
Here, the beginning of the ls -l
command output goes to the local console, then the remaining goes to the remote telnet client.
bcc -0 -ansi -Dconst= -Dvolatile= -DELKS=1 -DUNIX=1 -DDEBUG=1 -I/home/daivox/projects/github/elks/nano-X/src -I/usr/bcc/include -I/home/georg/elks-dev/OS-build/elks/include -O -DNONETWORK=1 -DERASEMOVE=1 -DUPDATEREGIONS=1 -c -o engine/devdraw.o engine/devdraw.c
bcc -0 -ansi -Dconst= -Dvolatile= -DELKS=1 -DUNIX=1 -DDEBUG=1 -I/home/daivox/projects/github/elks/nano-X/src -I/usr/bcc/include -I/home/georg/elks-dev/OS-build/elks/include -O -DNONETWORK=1 -DERASEMOVE=1 -DUPDATEREGIONS=1 -c -o engine/devmouse.o engine/devmouse.c
bcc -0 -ansi -Dconst= -Dvolatile= -DELKS=1 -DUNIX=1 -DDEBUG=1 -I/home/daivox/projects/github/elks/nano-X/src -I/usr/bcc/include -I/home/georg/elks-dev/OS-build/elks/include -O -DNONETWORK=1 -DERASEMOVE=1 -DUPDATEREGIONS=1 -c -o engine/devkbd.o engine/devkbd.c
bcc -0 -ansi -Dconst= -Dvolatile= -DELKS=1 -DUNIX=1 -DDEBUG=1 -I/home/daivox/projects/github/elks/nano-X/src -I/usr/bcc/include -I/home/georg/elks-dev/OS-build/elks/include -O -DNONETWORK=1 -DERASEMOVE=1 -DUPDATEREGIONS=1 -c -o engine/devclip.o engine/devclip.c
bcc -0 -ansi -Dconst= -Dvolatile= -DELKS=1 -DUNIX=1 -DDEBUG=1 -I/home/daivox/projects/github/elks/nano-X/src -I/usr/bcc/include -I/home/georg/elks-dev/OS-build/elks/include -O -DNONETWORK=1 -DERASEMOVE=1 -DUPDATEREGIONS=1 -c -o engine/devrgn.o engine/devrgn.c
bcc -0 -ansi -Dconst= -Dvolatile= -DELKS=1 -DUNIX=1 -DDEBUG=1 -I/home/daivox/projects/github/elks/nano-X/src -I/usr/bcc/include -I/home/georg/elks-dev/OS-build/elks/include -O -DNONETWORK=1 -DERASEMOVE=1 -DUPDATEREGIONS=1 -c -o engine/devpal1.o engine/devpal1.c
bcc -0 -ansi -Dconst= -Dvolatile= -DELKS=1 -DUNIX=1 -DDEBUG=1 -I/home/daivox/projects/github/elks/nano-X/src -I/usr/bcc/include -I/home/georg/elks-dev/OS-build/elks/include -O -DNONETWORK=1 -DERASEMOVE=1 -DUPDATEREGIONS=1 -c -o engine/devpal2.o engine/devpal2.c
bcc -0 -ansi -Dconst= -Dvolatile= -DELKS=1 -DUNIX=1 -DDEBUG=1 -I/home/daivox/projects/github/elks/nano-X/src -I/usr/bcc/include -I/home/georg/elks-dev/OS-build/elks/include -O -DNONETWORK=1 -DERASEMOVE=1 -DUPDATEREGIONS=1 -c -o engine/devpal4.o engine/devpal4.c
bcc -0 -ansi -Dconst= -Dvolatile= -DELKS=1 -DUNIX=1 -DDEBUG=1 -I/home/daivox/projects/github/elks/nano-X/src -I/usr/bcc/include -I/home/georg/elks-dev/OS-build/elks/include -O -DNONETWORK=1 -DERASEMOVE=1 -DUPDATEREGIONS=1 -c -o drivers/scr_bios.o drivers/scr_bios.c
drivers/scr_bios.c:40: error: Cannot open include file
why are patches being published on http://www.spinics.net/lists/linux-8086/maillist.html#00514 instead of being submitted to the source tree?
Setting processor type to 386 in the config cause the build to fail in bootsect.s (as86 -3):
00557 mov sectors, ax
***** illegal immediate mode...........................................^
***** mismatched size………………………………………………^
… and so on …
@jbruchon : as the toolchain migration would make ELKS unstable for quite a long time until we complete and mature the changes, I think it would be safer to branch from master into another one dedicated to that migration.
If you agree, could you then please create that new branch from master, and also set up both as protected in the project configuration ?
As reported by @Mellvik in #133, the last bytes of the data segment (.data
) are corrupted. For example, starting from the default configuration, enabling the NE2K driver, and after adding some traces with printk()
, the end of the data segment (just followed by the string tables) in the system
executable is:
00e010 6c 65 6e 3d 25 75 0a 00 6e 65 32 6b 5f 72 65 61 >len=%u..ne2k_rea<
00e020 64 3a 6c 65 6e 3d 25 75 0a 00 00 00 5f 6d 61 69 >d:len=%u...._mai<
00e030 6e 00 00 00 03 00 00 00 12 00 00 00 5f 5f 73 62 >n...........__sb<
00e040 73 73 00 00 06 00 00 00 1b 00 00 00 5f 5f 65 6e >ss..........__en<
The corresponding trace was added in `ne2k_main.c' line 40:
printk ("ne2k_read:len=%u\n", len);
But when running the /bin/eth
test program, output is:
Receive ARP reply...
ne2k_rea???
where ???
should rather be `d:len='.
End of the Image
file is correct:
00ea10 6c 65 6e 3d 25 75 0a 00 6e 65 32 6b 5f 72 65 61 >len=%u..ne2k_rea<
00ea20 64 3a 6c 65 6e 3d 25 75 0a 00 00 00 >d:len=%u....<
00ea2c
So the corruption occurs at runtime and looks to be aligned to the paragraph.
My ne2k ISA card is set to IRQ11, and does not support IRQ9. Changed ne2k.h: #define NE2K_IRQ 11
Compile and test. No cigar. Run on QEMU w/IRQ set to 11. Still no cigar. Set QEMU IRQ to 9. Voila!
So - changing the IRQ in ne2k.h does not seem to have any effects. Is this a bug or did I miss something?
ELKS currently depend on bcc for building. I was just wondering if it would be interesting to try with an alternative 16-bit compiler, like for example OpenWatcom
https://github.com/open-watcom/open-watcom-v2
If it not a completely stupid idea, I might have a go at it and try (I already got busybox to build for linux and win32 with Watcom). I have seen some wiki pages on watcom for OS development over at OSDev.
Mounting a FAT16 FS works (tested on physical and virtualbox), files can be copied in and out, some issues remain:
Reported in the mailing list:
http://www.spinics.net/lists/linux-8086/msg00675.html
http://www.spinics.net/lists/linux-8086/msg00680.html
When you mount a FAT16 disk and use ls
to list the files on this disk the message above will occur.
This is as far as I could trace it:
in msdos/dir.c
the function msdos_get_entry()
is called in line 244. This function is implemented in msdos/misc.c
. There it calls msdos_sread()
which calls map_buffer()
in fs/buffer.c
. The function map_buffer()
hangs with the message above.
The ls
command causes these calls to be repeated several times until bread()
in msdos_sread()
returns a buffer_head ptr
that cannot be handled in map_buffer()
.
You can generate a FAT16 disk image for testing by modifying lines 41 and 43 in
elkscmd/test/fat/build_fat32_hd_image.sh
. I.e uncomment line 43 and comment out line 41.
Georg
While testing the telnet client, I observe that, when the server sends much data, the client reads and displays only a part of this data, then blocks. One has to press a key to make the client to display next data. In Wireshark, these blocking times looks like to happen when the server reaches the TCP window limit advertised by ELKS, that is currently 2 * slip_mtu = 2 * 256 = 512 bytes.
When deselecting BIOS HD option in kernel configuration, the compilation fails on doshd.c, because the static global variable hdcount
is not more available for bioshd_ioctl(). Moreover, in this latest function, the minor number (so the disk number) is checked only against HD count, not (FD + HD) count.
Patch proposal is in commit 80de838.
Current implementation of select()
watches the regular wait queues through a special select_poll
wait queue and a pollhash
of the watched ones. But the hash is the same for two wait queues in the same address range of 256 bytes (see select.c
line 57). This is the case for the queues in the NE2K driver. As reported by @Mellvik in #133, effect is to wake up ktcp
on a write completion while it is waiting for a read completion, and to iterate for nothing on the file descriptors.
The readdir
fonction of the filesystem is called twice : the first entry is retained, but the second one is wasted, as the filldir
callback buffer has only one entry. Add a maximum count as a new parameter to speed up directory listing, or simplify the whole.
The current implementation of the ARP module makes the assumption that the next incoming packet after sending an ARP request will be the expected ARP reply. It works in QEMU, but in a real & more loaded network, some other packets might come between the request and the reply. Therefore the implementation of ARP should be kept asynchronous as the IP module.
Hitting ^C at the shell prompt cause the message
can't cd to ??oot/.profile
where ?? are garbage chars and the actual file name will vary. Occasionally the message will be different, such as 'HOME not set'.
Hitting a second ^C terminates the shell.
[ Tested with physical 286/AT and virtualbox]
As documented in LDD3 and ULK2 books, there is a possible race condition in the current sleep / wake implementation, as a task could be woken up between checking the sleep condition and putting the task to sleep.
It is unlikely to occur between tasks with a single CPU core if the condition check & sleep put are close to each other, but is more likely to occur when waking up from within an interrupt routine for fast devices, like the Ethernet and the HR timers.
Solution is to replace the current sleep_on ()
by the more modern wait_event ()
implementation, but with the condition expression replaced by a test function, to reduce the cost of macro expansion in term of code size.
When I load the http://elks.sourceforge.net/FAQ-English.html web page, I get the following error message when I click on any of the links provided. The same is the case with the web pages in other languages:
`An error has been encountered in accessing this page.
Reporting this problem: The problem you have encountered is with a project web site hosted by SourceForge.net. This issue should be reported to the SourceForge.net-hosted project (not to SourceForge.net).
If this is a severe or recurring/persistent problem, please do one of the following, and provide the error text (numbered 1 through 7, above):
Contact the project via their designated support resources.
Contact the project administrators of this project via email (see the upper right-hand corner of the Project Summary page for their usernames) at [email protected]
If you are a maintainer of this web content, please refer to the Site Documentation regarding web services for further assistance.
NOTE: As of 2008-10-23 directory index display has been disabled by default. This option may be re-enabled by the project by placing a file with the name ".htaccess" with this line:
Options +Indexes
`
From review and testing of PR #197:
The ROM filesystem currently does not support the symbolic link, resulting in an image build failure when packing the target
folder with the ROM
configuration option. In that folder, /bin/sh
is a link to either ash
or sash
, depending on the configuration.
There is an issue with there being no free disk space.... ><
Something to do with bash, maybe? If so, what shell is recommended to use?
root@kubuntu:/usr/src/elks/elkscmd# make full3
make[1]: Entering directory '/usr/src/elks/elkscmd'
/bin/sh: 1: [: missing ]
/bin/sh: 1: -e: not found
-e
*** Do builds in dev86 and dev86/bootblocks first ***
Makefile:147: recipe for target 'boot_blocks' failed
make[1]: *** [boot_blocks] Error 1
make[1]: Leaving directory '/usr/src/elks/elkscmd'
Makefile:206: recipe for target 'full3' failed
make: *** [full3] Error 2
with verbose tracing:
root@kubuntu:/usr/src/elks/elkscmd# make --trace full3
Makefile:206: target 'full3' does not exist
if [ "0" != "0" ]; \
then echo -e "\n\n *** Only root can build disk images *** \n\n"; exit 1; fi
make _build_bootable_target \
TARGET_FS=/usr/src/elks/elkscmd/full3 \
TARGET_RFS=rfs \
TARGET_BLKS=1440 \
INSTALL_KTCP=yes
make[1]: Entering directory '/usr/src/elks/elkscmd'
Makefile:147: update target 'boot_blocks' due to: /usr/src/elks/dev86/bootblocks/minix.bin /usr/src/elks/dev86/bootblocks/minix_elks.bin
if [ ! -e /usr/src/elks/dev86/bootblocks/minix.bin || ! -e /usr/src/elks/dev86/bootblocks/minix_elks.bin ]; \
then echo -e "\n\n *** Do builds in dev86 and dev86/bootblocks first *** \n\n"; exit 1; fi
/bin/sh: 1: [: missing ]
/bin/sh: 1: -e: not found
-e
*** Do builds in dev86 and dev86/bootblocks first ***
Makefile:147: recipe for target 'boot_blocks' failed
make[1]: *** [boot_blocks] Error 1
make[1]: Leaving directory '/usr/src/elks/elkscmd'
Makefile:206: recipe for target 'full3' failed
make: *** [full3] Error 2
Bootblocks from dev86 are there:
root@kubuntu:/usr/src/elks# ls -l /usr/src/elks/dev86/bootblocks/minix*.bin
-rw-r--r-- 1 root root 1024 Mär 4 12:56 /usr/src/elks/dev86/bootblocks/minix.bin
-rw-r--r-- 1 root root 281 Mär 4 12:56 /usr/src/elks/dev86/bootblocks/minix_elks.bin
-rw-r--r-- 1 root root 1024 Mär 4 12:56 /usr/src/elks/dev86/bootblocks/minixhd.bin
make[3]: Entering directory `/private/var/root/elks-git/elks/arch/i86/tools'
gcc -I ../../../include -o build build.c
WARNING: Invalid path ignored:
build.c:26:55: error: sys/sysmacros.h: No such file or directory
make[3]: *** [build] Error 1
"make menuconfig" enables pseudo ttys as default. The pty.c driver is compiled too.
However there are no ptys in the /dev directory and the MAKEDEV script states:
"# Pseudo-TTY master devices. These are not yet supported by the ELKS kernel."
Can ptys be enabled in the MAKEDEV script or do they not work at all? The code says they were implemented for nano-X.
I would like to port a telnet server and need a pty for that.
The following one line script will not echo the parameter passed:
echo $1
So if you run this script line with e.g. test.sh 123
it will not echo 123
You cannot use $1 with other commands as well.
Rework the GCC-IA16 build script after @lithoxs feedback, and @tkchia report of a new "stable" (= passed through the test suite) version of his fork (see tkchia/gcc-ia16#1).
From review and testing of PR #197:
The FAT image options are present in the configuration menu, but not active yet. Only the MINIX and ROM filesystems options are effective in image build.
Version: latest master (commit 661ac70).
The following code causes the process to crash after pressing a key:
int main ()
{
fd_set fdset;
FD_ZERO (&fdset);
FD_SET (0 /*fd*/, &fdset);
res = select (0 /*fd*/ + 1, &fdset, NULL, NULL, NULL);
Result is:
panic: wrong waitpt
apparent call stack:
(...)
@lithoxs : earlier this year, you announced that you started to compile the ELKS kernel with the latest GCC-IA6 (http://www.spinics.net/lists/linux-8086/msg00817.html).
As I can see in your PR flow, you still maintain the build with GCC-IA16, and it looks like, after tons of (more or less serious) posts to discuss that topic, that this compiler is today the best alternative to BCC.
Not only because of the work you already performed, but also because this GCC fork is still alive & able to be mainstreamed: https://github.com/tkchia/gcc-ia16
Even Alan is keeping an eye on this option: crtc-demos/gcc-ia16#4
It would be nice if you could provide some guidelines to use that compiler in the /Documentation folder, so that we could be more to use it to improve the ELKS code.
I have build elks and make boot image.
I want to make image with root system,so goto Elkscmd
Make images.zip,this makes error .
:~/elks/elkscmd$ sudo make images.zip
cp /home/xxx/elks/elks/arch/i86/boot/Image boot
make[1]: Entering directory `/home/xxx/elks/elkscmd'
/bin/sh: 1: [[: not found
/bin/sh: 1: -e: not found
-e
*** Do builds in dev86 and dev86/bootblocks first ***
make[1]: *** [boot_blocks] Error 1
make[1]: Leaving directory `/home/xxx/elks/elkscmd'
make: *** [comb] Error 2
Missing optionalization for the size of the block device array that impacts BSS size.
Reported by @lithoxs in jbruchon#167.
Last commit ([gcc] Close jbruchon#178 : update GCC-IA16) floods top level directory with a plethora of directories used in the intermediate steps of building a compiler. The mail goal of the project is to write a kernel (and its userspace), not the building of compilers.
Look at FUZIX (https://github.com/EtchedPixels/FUZIX), with similar goals than ELKS. You will not find there a "bin" directory to contain binaries of any compiler. And this project uses several compilers: sdcc, cc65, gcc-6809, even ia16-gcc. The documentation gives information on how to get required tools, but getting them is your problem.
It is a gross mistake to require a specific compiler to be able to compile ELKS. Rather, the Documentation must offer a range of options, from precompiled packages to directions on where to get the latest compilers. The top level README should point to the easiest options.
I will appreciate a definition on this issue.
When i try to load elks with my XT-IDE CF Adapter connected.
I choose to boot from floppy (by typing "A").
The kernel begins to load
Loadling elks
............................................................
And nothing more... no error logs.
When i disconnect the card, everything works fine.
Following Derek's problem report on the mailing list (http://www.spinics.net/lists/linux-8086/msg00770.html), document more the Ethernet stuff in the existing "ELKS networking" document.
i could not compile the unix socket support
When selecting the ROM version (CONFIG_ROMCODE), the build fails:
gcc -E -traditional -I/mnt/data/home/mfld/advantech/elks/elks/include -DELKS_VERSION_CODE=0x00020000 -DUTS_RELEASE=\"0.2.0\" -D__KERNEL__ -o irqtab.s irqtab.S
as86 -0 -o irqtab.o irqtab.s
00399 0010 891E 0000 mov stashed_ds,bx
***** unbound label.........................................^
00530 0083 8B1E 0000 mov bx,stashed_ds ! Recover the data segment
***** unbound label................................................^
00755 0147 8E1E 0000 mov ds,stashed_ds ! the org DS of kernel
***** unbound label................................................^
The reason is that GCC does not pre-process the #define stashed_ds
directive, that stills in the .s file:
#asm
.text
#define stashed_ds [0]
This causes AS86 to fail, as there is no stashed_ds
label, and that word has not been substituted to [0]
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.