diff -ruN /tmp/sos-code-article7.5/bootstrap/multiboot.h ../sos-code-article7.5/bootstrap/multiboot.h
--- /tmp/sos-code-article7.5/bootstrap/multiboot.h	2005-04-27 20:17:12.000000000 +0200
+++ ../sos-code-article7.5/bootstrap/multiboot.h	2005-04-27 23:15:15.000000000 +0200
@@ -47,10 +47,12 @@
 
 #include <sos/types.h>
 
+
 /* The address of the stack of the bootstrap thread */
 extern sos_vaddr_t bootstrap_stack_bottom;
 extern sos_size_t bootstrap_stack_size;
 
+
 /* Types.  */
 
 /* The Multiboot header.  */
diff -ruN /tmp/sos-code-article7.5/extra/bootsect.S ../sos-code-article7.5/extra/bootsect.S
--- /tmp/sos-code-article7.5/extra/bootsect.S	2005-04-27 20:17:13.000000000 +0200
+++ ../sos-code-article7.5/extra/bootsect.S	2005-04-27 23:15:16.000000000 +0200
@@ -1,10 +1,11 @@
 
 /*
- * @(#) $Id: bootsect.S,v 1.8 2004/11/20 16:00:11 d2 Exp $
+ * @(#) $Id: bootsect.S,v 1.9 2005/04/27 21:00:09 d2 Exp $
  * Description : Bootsecteur en syntaxe AT&T
  * Auteurs : Thomas Petazzoni & Fabrice Gautier & Emmanuel Marty
  *	     Jerome Petazzoni & Bernard Cassagne & coffeeman
  *	     David Decotigny
+ *           Christopher Goyet (RAM size determination through BIOS int 15H)
  * Bug reports to kos-misc@enix.org
  */
 
@@ -152,6 +153,12 @@
 	movb $0x3, %al
 	int 	$0x10
 
+	/* Recupere la taille de la RAM */
+	mov $0xE801, %ax
+	int $0x15
+	movw %ax, (memsize1)
+	movw %bx, (memsize2)
+
 	/* Affiche les messages d'attente */
 	movw $loadkern, %si
 	call message
@@ -313,6 +320,18 @@
 	movl %eax, %ss
 	movl $(stack + BOOT_STACK_SIZE), %ebp
 	movl %ebp, %esp
+
+/* passe les arguments a sos */                                       
+	xor %eax, %eax
+	xor %ebx, %ebx
+	movw (COPY_ADRESS+(memsize2)), %ax /*eax = num de block de 64KB apres 16MB*/
+	movw (COPY_ADRESS+(memsize1)), %bx /*ebx = num de block de 1KB entre 1MB et 16MB*/
+	movl $0x40, %ecx /*ecx=64 */
+	mul %ecx
+	add %ebx, %eax
+	pushl %eax  /* valeur de addr */
+	pushl $0x42244224 /*valeur de magic = magic de grub -1 */
+	pushl $0 /* normalement call fait un push eip, mais la on a un jmp*/
 	
 	/* Saut vers le noyau. La GDT est en place (flat mode), les
  	 * selecteurs aussi, a20 est ouverte, et les interruptions sont
@@ -373,7 +392,7 @@
 
      /* quelques messages */
 
-loadkern:  .string      "-= S O S =- : The Simple Operating System \r\n"
+loadkern:  .string      "S O S : The Simple Operating System \r\n"
 check:     .string      "Checking for a 386+ processor... "
 found386:  .string      " [OK]\r\n"
 need386:   .string      " [FAILED]\r\n"
@@ -381,6 +400,10 @@
 loading:   .string	"Loading... "
 haltmsg:   .string	"System Halted\r\n"
 
+     /* Variables pour stocker la taille de la RAM (int 0x15) */
+memsize1:  .long        0
+memsize2:  .long        0
+
 /*** Les code/données du boot secteur se terminent ICI. le marqueur de
  * fin (aa55) est ajouté automatiquement par le script ld
  * sos_bsect.lds ***/
diff -ruN /tmp/sos-code-article7.5/extra/Makefile ../sos-code-article7.5/extra/Makefile
--- /tmp/sos-code-article7.5/extra/Makefile	2005-04-27 20:17:13.000000000 +0200
+++ ../sos-code-article7.5/extra/Makefile	2005-04-27 23:15:16.000000000 +0200
@@ -1,4 +1,6 @@
 OBJCOPY=objcopy
+LIBGCC := $(shell $(CC) -print-libgcc-file-name) # To benefit from FP/64bits artihm.
+EXTRA := $(shell [ -f ../userland/userprogs.kimg ] && echo ../userland/userprogs.kimg)
 
 all: sos_qemu.img
 
@@ -31,7 +33,8 @@
 # above) because they share some symbol definitions
 sos_bsect.elf: bootsect.o compile_kernel
 	$(LD) --warn-common -T ./sos_bsect.lds -o $@ \
-		bootsect.o $(wildcard ../hwcore/*.o ../drivers/*.o ../sos/*.o)
+		bootsect.o $(wildcard ../hwcore/*.o ../drivers/*.o ../sos/*.o)\
+		$(EXTRA) $(LIBGCC)
 
 compile_kernel:
 	$(MAKE) -C ..
diff -ruN /tmp/sos-code-article7.5/extra/README ../sos-code-article7.5/extra/README
--- /tmp/sos-code-article7.5/extra/README	2005-04-27 20:17:13.000000000 +0200
+++ ../sos-code-article7.5/extra/README	2005-04-27 23:15:16.000000000 +0200
@@ -65,8 +65,15 @@
  - for cross-architecture compilation: see above
  - cd to this extra/ directory
  - run 'make'
- - the floppy image is: sos_bsect.img
- NOTE : SOS will not boot correctly this way after article 2 !
+ - the floppy image is: sos_bsect.img for use with bochs or on a real
+   floppy disk
+   to use the image under qemu: use sos_qemu.img
+
+ NOTE : From article 2 onward, be warned that using this bootsect
+        might lead to system crashes. This would be because the
+        solution we use to retrieve the RAM size might not work
+        properly on some systems (BIOS buggy or more than 1G RAM). THE
+        best way to boot SOS is always to use Grub.
 
 
 --
diff -ruN /tmp/sos-code-article7.5/hwcore/swintr.h ../sos-code-article7.5/hwcore/swintr.h
--- /tmp/sos-code-article7.5/hwcore/swintr.h	2005-04-27 20:17:16.000000000 +0200
+++ ../sos-code-article7.5/hwcore/swintr.h	2005-04-27 23:15:19.000000000 +0200
@@ -31,7 +31,6 @@
  */
 #define SOS_SWINTR_SOS_SYSCALL  0x42
 
-
 #if defined(KERNEL_SOS) && !defined(ASM_SOURCE)
 
 #include <hwcore/cpu_context.h>
diff -ruN /tmp/sos-code-article7.5/INSTALL ../sos-code-article7.5/INSTALL
--- /tmp/sos-code-article7.5/INSTALL	2005-04-27 20:17:12.000000000 +0200
+++ ../sos-code-article7.5/INSTALL	2005-04-27 23:15:15.000000000 +0200
@@ -64,9 +64,9 @@
       copy the file 'fd.img' to a floppy, and boot from it
 
  2nd method
-   => see extra/README to compile with the boot sector we provide (up to
-      article 2 only), copy the file 'extra/sos_bsect.img' to a floppy,
-      and boot from it
+   => see extra/README to compile with the boot sector we provide,
+      copy the file 'extra/sos_bsect.img' to a floppy, and boot from
+      it
 
 
 Inside a PC emulator (x86 and non-x86 hosts)
@@ -78,6 +78,7 @@
 installed: 'apt-get install libsdl1.2-dev' on debian
 testing/unstable).
 
+
  1/ Grub is installed on the host (x86 hosts only)
  - - - - - - - - - - - - - - - - - - - - - - - - -
 
@@ -90,6 +91,7 @@
    qemu: run 'qemu -fda fd.img'
      If grub hangs while loading the kernel, please go to method 2/
 
+
  2/ Grub is not installed (all hosts)
  - - - - - - - - - - - - - - - - - -
 
@@ -100,8 +102,9 @@
 
    qemu: run 'qemu -fda fd.img'
 
- 3/ Bonus: boot with the bootsector we provide (all hosts, up to art. 2 ONLY !)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+ 3/ Bonus: boot with the bootsector we provide (all hosts)
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   
   See extra/README to generate a floppy image with the boot sector we
   provide, and:
@@ -110,8 +113,10 @@
 
    qemu: run 'qemu -fda extra/sos_qemu.img'
 
-  NOTE: After article 2, this way of booting is not supported: please
-  use the method 2/ above.
+  NOTE: This technique assumes that INT 15H is supported by the
+  machine's BIOS. This should be OK for the vast majority of targets
+  (bochs, qemu, recent machines), but we do not guarantee it. In case
+  of doubt, please use Grub.
 
 
 NOTE : recommended versions of the tools
diff -ruN /tmp/sos-code-article7.5/README ../sos-code-article7.5/README
--- /tmp/sos-code-article7.5/README	2005-04-27 20:17:12.000000000 +0200
+++ ../sos-code-article7.5/README	2005-04-27 23:15:15.000000000 +0200
@@ -33,8 +33,7 @@
    i586-gnu) is available. Can be tested on real i486/pentium
    hardware, or on any host that can run an i486/pentium PC emulator
    (bochs or qemu)
- - kernel loaded by grub, or by a sample bootsector (up to article 2
-   ONLY)
+ - kernel loaded by grub or by a sample bootsector
  - clear separation of physical memory and virtual memory concepts,
    even inside the kernel: no identity-mapping of the physical memory
    inside the kernel (allows to move virtual mappings of kernel pages
@@ -54,7 +53,7 @@
    'all' and 'clean'
  - bootstrap/ directory: code to load the kernel. Both the stuff
    needed for a multiboot-compliant loader (eg grub) AND a bootsector
-   are provided. The bootsector may only be used up to article 2.
+   are provided.
  - sos/ directory: the entry routine for the kernel (main.c), various
    systemwide header files, a set of common useful C routines
    ("nano-klibc"), and kernel subsystems (kernel memory management,
diff -ruN /tmp/sos-code-article7.5/sos/main.c ../sos-code-article7.5/sos/main.c
--- /tmp/sos-code-article7.5/sos/main.c	2005-04-27 20:17:17.000000000 +0200
+++ ../sos-code-article7.5/sos/main.c	2005-04-27 23:15:19.000000000 +0200
@@ -16,6 +16,8 @@
    USA. 
 */
 
+#include <sos/errno.h>
+
 /* Include definitions of the multiboot standard */
 #include <bootstrap/multiboot.h>
 #include <hwcore/idt.h>
@@ -64,7 +66,6 @@
     }
 }
 
-
 /* Clock IRQ handler */
 static void clk_it(int intid)
 {
@@ -325,17 +326,14 @@
 /* ======================================================================
  * The C entry point of our operating system
  */
-void sos_main(unsigned long magic, unsigned long addr)
+void sos_main(unsigned long magic, unsigned long arg)
 {
   unsigned i;
   sos_paddr_t sos_kernel_core_base_paddr, sos_kernel_core_top_paddr;
   struct sos_time tick_resolution;
 
-  /* Grub sends us a structure, called multiboot_info_t with a lot of
-     precious informations about the system, see the multiboot
-     documentation for more information. */
-  multiboot_info_t *mbi;
-  mbi = (multiboot_info_t *) addr;
+  /* Size of RAM above 1MB. Might be undefined ! */
+  unsigned long int upper_mem = 0;
 
   /* Setup bochs and console, and clear the console */
   sos_bochs_setup();
@@ -345,15 +343,32 @@
 
   /* Greetings from SOS */
   if (magic == MULTIBOOT_BOOTLOADER_MAGIC)
-    /* Loaded with Grub */
-    sos_x86_videomem_printf(1, 0,
-			    SOS_X86_VIDEO_FG_YELLOW | SOS_X86_VIDEO_BG_BLUE,
-			    "Welcome From GRUB to %s%c RAM is %dMB (upper mem = 0x%x kB)",
-			    "SOS article 7.5", ',',
-			    (unsigned)(mbi->mem_upper >> 10) + 1,
-			    (unsigned)mbi->mem_upper);
+    {
+      /* Grub sends us a structure, called multiboot_info_t with a lot of
+	 precious informations about the system, see the multiboot
+	 documentation for more information. */
+      multiboot_info_t *mbi = (multiboot_info_t *) arg;
+      upper_mem = mbi->mem_upper;
+      sos_x86_videomem_printf(1, 0,
+			      SOS_X86_VIDEO_FG_YELLOW | SOS_X86_VIDEO_BG_BLUE,
+			      "Welcome From GRUB to %s%c RAM is %dMB (upper mem = 0x%x kB)",
+			      "SOS article 7.5", ',',
+			      (unsigned)(upper_mem >> 10) + 1,
+			      (unsigned)upper_mem);
+    }
+  else if (magic == 0x42244224)
+    {
+      /* Loaded with SOS bootsect */
+      upper_mem = arg;
+      sos_x86_videomem_printf(1, 0,
+			      SOS_X86_VIDEO_FG_YELLOW | SOS_X86_VIDEO_BG_BLUE,
+			      "Welcome to %s%c RAM is %dMB (upper mem = 0x%x kB)",
+			      "SOS article 7.5", ',',
+			      (unsigned)(upper_mem >> 10) + 1,
+			      (unsigned)upper_mem);
+    }
   else
-    /* Not loaded with grub */
+    /* Not loaded with grub, not from an enhanced bootsect */
     sos_x86_videomem_printf(1, 0,
 			    SOS_X86_VIDEO_FG_YELLOW | SOS_X86_VIDEO_BG_BLUE,
 			    "Welcome to SOS article 7.5");
@@ -376,14 +391,14 @@
   tick_resolution = (struct sos_time) { .sec=0, .nanosec=10000000UL };
   sos_time_subsysem_setup(& tick_resolution);
 
-  /* We need a multiboot-compliant boot loader to get the size of the RAM */
-  if (magic != MULTIBOOT_BOOTLOADER_MAGIC)
+  /* We need to know the RAM size */
+  if (upper_mem == 0)
     {
       sos_x86_videomem_putstring(20, 0,
 				 SOS_X86_VIDEO_FG_LTRED
 				   | SOS_X86_VIDEO_BG_BLUE
 				   | SOS_X86_VIDEO_FG_BLINKING,
-				 "I'm not loaded with Grub !");
+				 "I don't know RAM size ! Load me with Grub...");
       /* STOP ! */
       for (;;)
 	continue;
@@ -404,7 +419,7 @@
   /* Multiboot says: "The value returned for upper memory is maximally
      the address of the first upper memory hole minus 1 megabyte.". It
      also adds: "It is not guaranteed to be this value." aka "YMMV" ;) */
-  sos_physmem_subsystem_setup((mbi->mem_upper<<10) + (1<<20),
+  sos_physmem_subsystem_setup((upper_mem<<10) + (1<<20),
 			      & sos_kernel_core_base_paddr,
 			      & sos_kernel_core_top_paddr);
   
@@ -495,7 +510,6 @@
   /* Start the 'init' process, which in turns launches the other
      programs */
   start_init();
-
   /*
    * We can safely exit from this function now, for there is already
    * an idle Kernel thread ready to make the CPU busy working...
