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.

Tuesday, April 12, 2011

Revision 7 released - Introducing LFClass

So here it is, a new revision of LFScript 4, and a few (big) announcements.


Functional changes
The most important functional change is the addition of the new LFClass library, which is now required for ./lfscript to run properly (because the new, fast and improved dependency resolution has been written in Java).

This introduction of a Java based application into the core of LFScript will (hopefully) go unnoticed for most people, because two standalone executables (one for 32-bit and one for 64-bit) are included in the release, making the presence of a JVM entirely optional.

However, if you do experience problems, please file a bug on it.

A list of all code changes can be found in the changelog. 

The road to LFScript 5
LFScript 4 will be used as a platform for the development of LFClass, which eventually will become the fifth rewrite of LFScript, warranting a version bump to 5.0.

Because LFClass will be developed at the same time as LFScript 4 (gradually replacing LFScript 4 code with LFClass), version 5.0 will slowly come into existence, while previous version bumps where instantaneous.

While not all code has been replaced with Java, LFScript will keep a version number 4. Revision 7 includes LFScript 4 v0.4.

Legal changes
LFClass (which includes ScriptFactory) is released under the MIT (Expat) license. The license is short, simple, permissive and accurately describes how I currently feel my software should be used.

However, the main application in LFScript  ('./lfscript') will remain GPL licensed until all of it's contents have been remade in Java.

As all scripts generated from LFS and BLFS already were MIT licensed, you can deduce that in time all of LFScript will be MIT licensed.

(Note that the binaries included in revision 7 in 'lfc/build' are also subject to other licenses. Read 'lfc/binary-license.txt' for details) 

Download
Link to the latest version: http://lfscript.org/latest.tar.bz2

Saturday, April 9, 2011

Development code access and contributions

In stead of periodically uploading new revisions, I now give you direct read-access to my local development copy of LFScript. This copy may not always be in working order (you should never assume it is), but it is the exact version I'm currently working on. Any change I ever make, is on-line in minutes.

There are two ways to access my files, either by viewing them online through a web interface, or by launching an on-line version of Wuala (no login is required in either case).

The web interface is limited. If you want to download more than one file, use the on-line version of Wuala; In the web interface, click "Open in Wuala" (Java required).

Also, anyone with a free account can now upload their own contributions to the new "lfscript" Wuala group. Any contributions made are also visible to people without an account. Any contribution should be either in the public domain or MIT (Expat) licensed, otherwise it is removed.

Any contribution which is properly licensed, will remain available either in this group or will be moved to LFScript's development folder. So even if it is not included in LFScript, it will remain published here (unless you yourself removes it).

Thursday, April 7, 2011

Three new video's

Well, I will never speak of release dates again. It seems I do not keep to them anyway. So I won't tell you that I'll release LFScript rev. 7 within 48 hours. No, you will not get it out of me...

I will tell you however, that today I've produced three new video tutorials. One of them is not a screencast of a Virtual Machine. Can you tell which one?

Installing a system (using LFScript)

Creating a Live CD

Installing the live cd system (without using LFScript)

Saturday, April 2, 2011

Al-... most... done....

I'm currently building the 32-bit binaries for the next Live CD. Tonight I'll build the 64-bit base system. Tomorrow I'll combine the two in one ISO and publish it.

As usual, there are some scripts which do not quite like the upgrade to the new version of LFS and BLFS... (Oh yeah, surprise! I do include scripts from the latest snapshot of BLFS in next release.) If this last rebuild again presents these problems, the Live CD will feature KDE3 in stead of Gnome, but released it will be!

LFScript rev. 7 may possibly be released later today, and otherwise it will be released together with the Live CD, tomorrow.

Also, I've been working on the dependency resolution issue I blogged about a few months ago. Possibly, a fix will be included in rev. 8. However, the fix might be a bit unorthodox... More on this later...

Thursday, March 24, 2011

Passed SCJP

Today I passed the SCJP (or OCPJP, as it is now known) exam. This makes me a certified professional Java programmer.


Preparing for this exam caused some delays in updating LFScript to be able to work with LFS-6.8. However, I am happy to report that I will make up for the delay next week. By April 2nd, LFScript should be back on track:
  • A new video tutorial (Installing an LFS system) will be recorded in the next couple of days. This should complete the basic set of tutorials.
  • I'll be releasing an updated Live CD containing LFS-6.8 in both 32- and 64-bit, some programs, X and Gnome from BLFS (probably no version change and in 32-bit only).
  • VLC media player will be included in LFScript. A small but long awaited addition.

Also, if you have asked questions through Launchpad, here, or anywhere, I will be answering them in the next few days.

Unrelated to LFScript; I'm creating a web page for some of my Java based projects. Some of you might have seen some of it already, as it has been in development for some time. The "flagship" of these projects will be a Text User Interface inspired by Java's own Swing framework. Several other projects which will work nicely together with the TUI will be grouped together in a project I'm calling "Cabowter".

A custom font (based upon this one, but expanded to cover several universal character sets) from one of the Cabowter projects will also be included as the default text-mode font on the LFScript Live CD.

You're up to date.