From b952d9d9007db93c04c6a0d1a9e36aecd53b8362 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Sun, 23 Dec 2018 17:52:55 +0100 Subject: [PATCH] Issue with length of loader.bin, and can't load kernel for now --- bin/disk.img | Bin 18944000 -> 18944000 bytes bin/loader.bin | Bin 1002 -> 1171 bytes bin/mbr.bin | Bin 512 -> 512 bytes obj/boot/loader.bin | Bin 1002 -> 1171 bytes obj/boot/mbr.bin | Bin 512 -> 512 bytes src/boot/loader.s | 80 +++++++++++++++++++++++++++++------------- src/boot/loader16.inc | 1 + src/boot/mbr.inc | 3 +- 8 files changed, 58 insertions(+), 26 deletions(-) diff --git a/bin/disk.img b/bin/disk.img index beefdec936f8d328364a9e9bbb1f74bb163acbb4..10b049d2fd39dbb9423802f166b70d3f1f7e671e 100644 GIT binary patch delta 73812 zcmeHQ4SW>UwVw%W2noq1>`uNAvH^k+NlXYr2w$NR3_?N#Olf~@FhVd<2sXs8_pG6f zzlvf3S!HXLS6^B`eto`bjn|}-9{lVTl=ia$9dopw8fByHJJ6j*Ree_oN|72{OeMHRe7_YZIJ8r{@-Epygn~&v9 zUO#V#qry=k2*pq?7wjVi;rJ#YPpA;egmS?w+&5cTZ9nkXJgcuG?x1$G|NCRMs_TS0 zp-E_jZ?kZCqmVCLEi}L;e!TEGUbeEbY`M+$y`_~lL3mK!Q?Un*RtF^n8xp0M0 zghwkPN1LDQ-cHX7%Xz|yQE>WgOP+Fk<)$qG&g)MMi4?6x{E@nzIiYY_yc(c|?xx58m|j?Bpf0Tg4Qcu{bV7L+__Y)_Ew zW1(Xi*3I%GSf7LSczGlaK>C>F7f_zf$R*mp3gx32c~1}Qo0vk6-VGaFvGRej%8TuX zPbQAsQ!KtNUKr#|TZjBit@@cdo8S_{lYJgeHlCbp%s7+djbhOmQ!hRH%pCC#V#}`R ze)#df1NwLNcbU%lR==UHz`A-vm0?}Ip-3O~hRS2)*|a~op(I8=8taMlD(yLw2)FZX za981F`r7IC_fJYOyWM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t`HEe(=S1I)z5^X%`~t7`2rwW6D*>sAA~vi70*fRBCWgk<@5>c>@$P@zi@E># zn}nIe_OS@Rxc`6OE}<7U|HnO<#KZJ#5?Ji?{}<{1U-U*U zQ~m${e?5?$_TNlG07wW3ypj;)09)D5DkjLl(9bFYB-3^XFo4|D_n_}Z-vxe!2hArG z_>~?^wq?wgkN`R{i{Zbi0FZu_EX=?l!QgS6MU`vv0Y;^IE+9WFe2oo5iGmGRiM$PO ziRG$}8>>8;feL_9Ody65i1GS%eB5D=ZWdK3AkTvlA`PP%k24;By(<7D4N~l(36a*k z4zdU&0s;}QXS|-qsSsSAS(2QQnU}6mlCLoNB9p@86ebZNr~Ld9keGk4zPExRFBdP@ zpR$%f3vtP1|#T)dO-GAmC0!DLzA4{-sI5(1jLhv5S!!wb8A|Nn31-Zxo@f#F3M zh|Rxm8Hnu#Vsill9moc&;RgmikZpt{t_D#b01}r%66XW4dG~37^fCe2ui5rp6nb%% O 2.0 kB... diff --git a/src/boot/loader16.inc b/src/boot/loader16.inc index 56d9840..a30cff9 100644 --- a/src/boot/loader16.inc +++ b/src/boot/loader16.inc @@ -7,6 +7,7 @@ ; Desc: Kernel (second stage) Loader for OS/K INCLUDED FUNCTIONS ; ; (x86_64 architecture only) ; ;=----------------------------------------------------------------------------=; + [BITS 16] disable_cursor: diff --git a/src/boot/mbr.inc b/src/boot/mbr.inc index 5e06bc9..0e121e6 100644 --- a/src/boot/mbr.inc +++ b/src/boot/mbr.inc @@ -7,6 +7,7 @@ ; Desc: Bootsector for OS/K INCLUDED FUNCTIONS ; ; (x86_64 architecture only) ; ;=----------------------------------------------------------------------------=; +[BITS 16] read_clusters: ;---------------------------------------------------; @@ -100,7 +101,7 @@ read_sectors: shl ah, 1 or cl, ah ; Now cx is set with respective track and sector numbers mov dl, byte [Bootdrv] ; Set correct Bootdrv for int 13h - mov di, 5 ; Try five times to read the sector because i love 5 + mov di, 21 ; Try five times to read the sector because i love 21 .attempt_read: mov ax, 0x0201 ; Read Sectors func of int 13h, read one sector int 0x13 ; Call int 13h (BIOS disk I/O)