Sunday, July 31, 2011

Thunder/Lightening demo

Tomorrow I'll release the code for Thunder, Lightening and a few other tools.

This weekend I've been writing a user interface (using Thunder) for Spider Solitaire, which for now will be the default demo of the project.

You can try the demo here (Java required).

Screenshots
On Windows XP (custom platform independent terminal):


On Ubuntu (xterm):


On Ubuntu (gnome-terminal):

Wednesday, July 27, 2011

Introducing Thunder & Lightening

(note the "e" in "Lightening")



I'm happy to announce that a development version of a new text user interface system for Java (that I have called "Thunder", due to it's visual likeness to Visual Basic for DOS) will be released on the first of August.

The project is able to run on Avian, the minimalist Java VM that is also used in LFClass, making it an excellent choice for use in embedded systems.

This project will provide the UI for LFScript 5. Also, the current prompt based interactive configurator in LFScript 4 will soon get a Thunder based user interface.



In addition to being able to run on a Unix terminal, a cross-platform GUI terminal enables applications based on Thunder/Lightening to run on any graphical OS, including Windows and Mac.

Thunder (and Lightening) will get their own project page at
http://marcelweb.nl/thunder/.



"Thunder" versus "Lightening"
Thunder is based on another new project of mine, which I have called "Lightening". The name "Lightening" was chosen because the code is leight weight (meaning platform independent) and indeed closely related to "Thunder".

Lightening provides back end services for widgets (like event dispatching), while Thunder provides the actual widgets and thus the look and feel. Developers will often only deal with the Thunder API.

The Lightening API is flexible enough to allow other kinds of user interfaces to be built on top of it (for example a graphical UI) but since there already are many excellent projects providing GUI's (Swing and SWT among others) the primary focus is Text UI's through Thunder. Also, Thunder currently only implements one look (or theme), while in the future it will probably be extended to provide a pluggable look and feel.

Saturday, June 4, 2011

Revision 10 and what to do before LFScript 4 goes stable

LFScript 4 revision 10 will be released in a few minutes.
It contains a few bugfixes, it makes the build of Gnome more stable and scripts for VLC media player and OpenJDK are now ready for use.

'TODO' overview
The short version of what is left to do is: Make sure that LFScript 4 contains
everything that was in LFScript 3.3 and a proper fsOS2 Live CD (or DVD) can be
produced for both 32-bit and 64-bit machines.

The rest of this blog post will explain what is exactly on my 'TODO' list before I will declare LFScript 4 as "stable" and it will get version number 1.0 (it is now version 0.7). Note that I may release a few more revisions before this happens.

Numbers in this article (like #766168) refer to bug entries in Launchpad
(https://bugs.launchpad.net/lfscript). It is there that you can check the status
for each item on this list. When all bugs have been fixed, 1.0 will be released.

Make sure everything in Gnome works perfectly
At this moment (revision 10) Gnome will compile without problems, but at run time there are still some minor problems:
  • GDM will not allow you to login (it does not display a list of users or user/password text fields), nor will it allow you to reboot or shutdown, making it pretty useless (#792918).
  • If GDM is run at boot (as the default display manager), it will block the initialization of text mode logins, making it impossible to login in any way (#792919).
  • The Gnome menu editor will not work if PyGTK is not installed. PyGTK is currently not a dependency of any Gnome script (#792920).

Some additional software should also be included, in particular Gnome-Media (to allow volume control in Gnome) and GParted (partitioning software) (#792921).

Other issues
There are also still some minor problems with non-gnome scripts;
  • Firefox does not link to the Java plugin if OpenJDK is installed (#792925).
  • Firefox does not have an entry in the Gnome applications menu (#792927).
There are also some things which are still to be implemented for a Live CD:
  • A live CD should be ejected before shutdown or reboot (#792928).
  • The live CD should start with the console linked to a framebuffer device (this will allow Tux to present itself at boot and provide better color support for text-mode applications). The script 'init.sh' does not create a framebuffer device file (#792930).

Add remaining scripts from LFScript 3.3 (#766168)
Scripts which were available in LFScript 3.3, but still need to be updated for use in LFScript 4:
  • Xfce additional software (beyond xfce-core)
  • KDE additional software (beyond kdebase)
  • Gnome runtime requirements (consolekit, pygtk)
  • Gnome additional software (a few have already been included in LFScript 4, but not all)
  • Thunderbird
  • A nice theme (I used 'candido' in LFScript 3, but maybe fsos2 should have something new)
  • Extra fonts

Written documentation (#792932)
Because LFScript 4 has had quite a few changes recently, I've deliberately neglected to keep the documentation up to date (with the exception of the video tutorials). After all, what's the point in writing extensive documentation for features that will change or be dropped shortly after. But now, I feel that it's time to write some complete and properly formatted (as in: not only in plain text, maybe in docbook) documentation.

Merge scripts into ScriptFactory (#792933)
My latest revisions have been about implementing scripts, and not about preserving the differences to be applied in later versions of LFS and BLFS. Most people do not use ScriptFactory at all (and may even think "What the hell is ScriptFactory?") so this is only a minor issue. But it is something that needs to be done for a 1.0 release.

Did I miss something?
It's possible I'll uncover some other minor issues in the time before I release 1.0, in which case I'll file a bug on it at Launchpad.

The bug reporting tool is open for everyone with Launchpad account (which you can get for free). So, if something is missing from this list and also not yet reported on Launchpad (see link at the top of this post) feel free to report it.

Monday, May 30, 2011

Revision 9 released

This revision includes scripts for LFS-6.8 and BLFS-r8882. There have been a number of changes and a lot of bugfixes. Some highlights:
  • Added script for Xfce 4.8.
  • Gnome should now be able to build and run properly.
  • Added an interactive configuration utility which will run when you install a system. This will set up the default window manager and automatically configure your system to start in graphical mode (if you have X11 installed) and prompt you to set a root password.
  • Improved on the way log files are stored.
  • Added support for PRE-installation scripts.

Wednesday, May 11, 2011

Revision 8 released

LFScript 4 revision 8 has been released.

This is mostly a bugfix release. This revision includes scripts for LFS-6.8 and BLFS-r8879 (just like revision 7 did).

One new feature deserves a mention though; Whenever a specified URL in any script is no longer valid, LFScript will now automatically try to download that file from my new code repository (see my previous blog entry).

Tuesday, May 10, 2011

Mirror time

I've received a few reports about source code download problems and MD5 checksum failures.

MD5 issues
The MD5 failures are almost always for the LFS bootscripts and Udev configuration tarball. This issue is mostly my fault, as I placed the development URL for these sources in the scripts. The development sources are re-created daily by the LFS folks, thereby also changing the checksum daily. The next LFScript revision will reference the proper 6.8 download locations.

It's worth noting that whenever I fix something like this, you can download the fixed files from the development repository (http://www.wuala.com/marcelvdboer/Sync/lfscript-4.0). Also, if a bug report has been filed, it will be set to "Fix committed" indicating you can download it from that repository.

Source code repository
There are also people who don't like the fact that after a revision of LFScript has been released for some time, some source code packages are not downloaded automatically any more. This is due to the fact that some developers move or even remove source code from the web whenever a new version of their software is released. Though it seems easy enough to go to Google, type in the missing file name, then download it manually to the sources directory, people still complain about this.

To solve this issue, I'm now building a source code mirror of my own, and the next revision of LFScript will automatically try this repository if a primary URL is down. I didn't want to link to third party repositories because of the (remote) possibility it will increase their traffic too much. The repository will contain source code for scripts included in the most recent version of LFScript only.

The repository is accessible through http://lfscript.org/sources. You can use this link to verify the repository contains a required file (and then let me know if it doesn't, so I can fix it), but you should not download files manually from there. Use LFScript to download your files.

It's still under some construction, but the repository should be fully populated by the time the next revision of LFScript is released.

Saturday, May 7, 2011

Useless OS 1.2 - x86 assembly

This is a bit of a technical entry, which by the way has nothing to do with LFScript at all...

For one of my projects, I'm learning a bit of x86 assembly.

Some initial goals were:
- Print a string of text on the screen
- Be able to use all 16 colours
- Position the text cursor
- Do NOT use BIOS interrupts (because it may eventually have to run in protected mode)

I came up with this:

%define  CODE_BASE  0x07C0

;; 'UselessOS 1.2' a.k.a. 'Print some coloured text, position a cursor and quit'
;; Created: 2011-05-06/2011-05-07
;; By: Marcel van den Boer
;;
;; Released in the PUBLIC DOMAIN
;;
;; Build and run with:
;;   $ nasm -f bin -o colortext.bin colortext.asm
;;   $ dd if=/dev/zero of=colortext.img bs=2880 count=512
;;   $ dd status=noxfer conv=notrunc if=colortext.bin of=colortext.img
;;   $ qemu -fda colortext.img
;;
;; Resources:
;; - http://mikeos.berlios.de/write-your-own-os.html
;; - http://www.jamesmolloy.co.uk/tutorial_html/
;; - http://wiki.osdev.org/Memory_Map_%28x86%29
;; - http://www.tarleton.edu/computerscience/documents/CS%20380/ ...
;;          ... Labs/Lab%203%20-%20Kernel.pdf

; Color definitions
%define  BLACK    0x0
%define  BLUE     0x1
%define  GREEN    0x2
%define  CYAN     0x3
%define  RED      0x4
%define  MAGENTA  0x5
%define  YELLOW   0x6
%define  WHITE    0x7

; Color brightness
%define  NORMAL   0x0
%define  BRIGHT   0x8

; Video memory facts
%define  COLOR       (BACKGROUND << 4 | FOREGROUND)
%define  CURSOR      ((CURSOR_Y * COLUMNS) + CURSOR_X)
%define  VIDEO_BASE  0xB800
%define  COLUMNS     80
%define  ROWS        25

; Text to print
%define  MESSAGE  'Useless OS 1.2 loaded... Goodbye!'
%define  FOREGROUND  (YELLOW | BRIGHT)
%define  BACKGROUND  (BLUE   | BRIGHT)

; Where to place the cursor
%define  CURSOR_X  79
%define  CURSOR_Y  24

init:
    ; Note: This section marked 'init' is not required for the remaining code
    ;       It's just here for my own reference
    cli

    ; Set up stack
    mov ax, 0x07E0
    mov ss, ax
    mov esp, (0x0007FFFF - 0x00007E00)

cursor:
    ; Lower byte
    mov byte al, 0x0F
    mov word dx, 0x03D4
    out dx, al

    mov byte al, CURSOR
    mov word dx, 0x03D5
    out dx, al

    ; Upper byte
    mov byte al, 0x0E
    mov word dx, 0x03D4
    out dx, al

    mov byte al, CURSOR >> 8
    mov word dx, 0x03D5
    out dx, al

start:
    ; Initialize registers which will be modified later (pointers)
    mov word si, 0
    mov word di, MSG_BASE

    ; Initialze registers with non-changing data
    mov word ax, CODE_BASE
    mov word bx, VIDEO_BASE

    ; Set character color
    mov byte ch, COLOR

fetch:
    ; Fetches the next character
    mov word ds, ax     ; Align with code
    mov byte cl, [di]   ; Fetch character
    inc di              ; Increment character index

print:
    ; Prints the most recently loaded character
    mov word ds, bx     ; Align with video memory
    mov word [si], cx   ; Print character
    add si, 2           ; Increment video index

branch:
    ; Fetch the next character if the end of the string has not been reached
    cmp cl, 0
    jne fetch

    ; Otherwise fill the screen with the last (null) character
    cmp si, (COLUMNS * ROWS * 2)
    jl print

end:
    ; Finally, wait forever
    jmp $

data:
    MSG_BASE db MESSAGE, 0

padding:
    ; Required to be recognized as a boot sector
    times 510-($-$$) db 0
    dw 0xAA55


(It is has version number 1.2 because: "1.0" printed the string and cleared the screen, "1.1" added colour and "1.2" added cursor management. Though every version was made in the last two days.)

Enjoy.