Commit graph

98 commits

Author SHA1 Message Date
cinap_lenrek 65bd53b9b8 imx8: load a plan9.ini at CONFADDR 0x40010000 2022-07-10 16:40:36 +00:00
cinap_lenrek 7bae48c452 generate boot.scr in /sys/src/boot/reform 2022-06-18 18:23:22 +00:00
cinap_lenrek a16d54da37 add /sys/src/boot/reform/mkfile to download official u-boot for the mnt-reform 2022-06-18 18:15:16 +00:00
cinap_lenrek 546f8cfeca 9boot: fix isowalk() for directories spanning multiple sectors
directory entries cannot span sector boundaries, meaning
that the end of a sector would be zero padded until the
next sector.

we have to skip over these zero paddings to fully read
the directory.
2021-09-11 12:26:35 +00:00
Ori Bernstein bcfee7b547 revert 8c228a123fa0c6062570964011854302bbf57242: accidental commit
was testing out the git/import tweaks and accidentally
pushed this commit. No comment on whether we want it,
but it definitely wasn't ready for merge.

Oops.
2021-08-22 17:47:38 +00:00
unobe@cpan.org 8c228a123f mk for only supported archs
http://fqa.9front.org/fqa1.html#1.2 states the supported archs.
However, clean and nuke also remove build files for 0 (spim) and q
(power).  'mk all' using those archs fails; 'mk kernels' also tries to
build all the kernels, even those which are not supported.  For
example, I tried to build the power arch (qc, qa, ql) and without
surprise it failed (when building dtracy): ...
mk dtracy
qc -FTVw dtracy.c
yacc -v -d -D1 parse.y
qc -FTVw cgen.c
qc -FTVw act.c
qc -FTVw type.c
 == regfree ==
REGISTER R0 <11> STRUCT DTAct cgen.c:302
 == regfree ==

REGISTER R0 <11> STRUCT DTAct act.c:266

 == regfree ==
qc -FTVw agg.c
cgen.c:299 unknown type in regalloc: STRUCT DTAct
cgen.c:299 bad opcode in gmove INT -> STRUCT DTAct
cgen.c:302 unknown type in regalloc: STRUCT DTAct
cgen.c:302 bad opcode in gmove INT -> STRUCT DTAct
cgen.c:302 error in regfree: 0 [0]
REGISTERmk: qc -FTVw cgen.c  : exit status=rc 387386: qc 387392: error R0
 <11> STRUCT DTAct act.c:269

act.c:250 unknown type in regalloc: STRUCT DTAct
act.c:250 bad opcode in gmove INT -> STRUCT DTAct
act.c:266 unknown type in regalloc: STRUCT DTAct
act.c:266 bad opcode in gmove INT -> STRUCT DTAct
act.c:266 error in regfree: 0 [0]
act.c:269 unknown type in regalloc: STRUCT DTAct
act.c:269 bad opcode in gmove INT -> STRUCT DTAct
act.c:269 error in regfree: 0 [0]
act.c:274 unknown type in regalloc: STRUCT DTAct
act.c:274 bad opcode in gmove INT -> STRUCT DTAct
act.c:274 error in regfree: 0 [0]
too many errors
mk: for(i in cc ...  : exit status=rc 382748: rc 387379: mk 387381: error
mk: date for (i ...  : exit status=rc 373781: rc 382226: mk 382227: error
cpu%

The patch below skips over non-supported architectures.  Is that
something we want?  This way, 'mk kernels' should work without a
problem (tested on amd64).  Then if someone works on getting those
architectures supported again in the future, they can be added back
in.
2021-08-17 14:00:47 +00:00
cinap_lenrek 5347bb9c96 boot/bcm: download dtb files for rpi-400 and rpi-cm4 2021-02-22 23:44:28 +01:00
cinap_lenrek 48e795005d 9boot: handle automatic length for 64-bit values in hexfmt() for framebuffer address (thanks Michael Forney) 2021-02-20 12:55:42 +01:00
cinap_lenrek 04bf70d344 9boot: mark efi boot and runtime service regions as reserved
despite the kernel never doing any efi runtime service calls,
overriding the runtime service regions makes some machines
lock up. so consider them reserved.

the boot service regions should also, in theory, be usable
by the os, but linux says otherwise...
2021-02-15 01:49:30 +01:00
mischief 486ce60546 efi: prefer plan9.ini from ESP we loaded from
currently the EFI loader's behavior is to search all disks in a
firmware-defined order.  we search the list returned by the firmware
in reverse order in the hopes of searching the first 9FAT instead of
the ESP, but this results in unintuitive behavior when there are
multiple FAT partitions (possibly in multiple disks), such as loading
a plan9.ini and kernel from a different disk than the one you executed
the EFI loader from.

to resolve this, we change the EFI loader to instead prefer read
plan9.ini and the kernel from the same disk as the EFI loader was read
from, and then fall back to the old behavior, since the old behavior
is relied on by current installations.
2020-11-21 14:18:52 -08:00
cinap_lenrek 6041d2048c 9bootpxe: simplify 2020-04-08 23:48:09 +02:00
cinap_lenrek abc5a66c56 9bootpxe: continues the war against random DHCPv6 DUIDs
Some UEFI implementations use random UUID based DUID instead of
ethernet address, but use ethernet derived link-local addresses.
So extract the MAC from our IPv6 address.
2020-04-08 23:37:38 +02:00
cinap_lenrek ac98922f44 add missing device tree file for raspberry pi 4 2019-08-18 22:19:29 +02:00
cinap_lenrek 534be5aeb3 add raspberry pi 4 kernel and bootloader to pi3.img target 2019-08-18 21:43:04 +02:00
cinap_lenrek f059563b9d add /sys/src/boot/bcm/mkfile to download raspberry pi bootcode firmware 2018-10-22 00:15:39 +02:00
cinap_lenrek ce062debb1 9boot: get rid of 64 byte line length limit 2018-10-06 02:42:53 +02:00
cinap_lenrek ed41dd5b28 9boot: don't let user erase the prompt (thanks mischief) 2018-09-16 13:47:33 +02:00
cinap_lenrek 8f9642a514 9boot: detect SYSLINUX "memdisk" and pass to kernel via ramdisk0= parameter
this makes virtual "memdisk" from SYSLINUX accessible to
the kernel, allowing the iso to be loaded via TFTP and
started without any ethernet or disk drivers available.
2018-05-27 23:03:38 +02:00
cinap_lenrek 5c2b4dfc81 9boot: DHCPv6 support for efi 2018-05-15 02:18:50 +02:00
aiju debb786fea aijuboard bootloader: fix 10BASE-T / 100BASE-TX support 2018-02-10 13:15:57 +00:00
cinap_lenrek a9b4126468 9boot: limit read size to 4K for efi simple file system protocol
copying files from the uefi shell works, reading plan9.ini works,
loading the kernel by calling Read to read in the DATA section of
the kernel *FAILS*. my guess is that uefi filesystem driver or
nvme driver tries to allocate a temporary buffer and hasnt got
the space. limiting the read size fixes it.
2017-09-29 21:19:12 +02:00
cinap_lenrek be7f3fb5e4 rename pcf kernel to pc, remove pcf, pccpuf, pccpu64 kernels, update documentation
there isnt much of a point in keep maintaining separate
kernel configurations for terminal and cpu kernels as
the role can be switched with service=cpu boot parameter.

to make stuff cosistent, we will just have one "pc" kernel
and one "pc64" kernel configuration now.
2017-09-10 22:35:23 +02:00
cinap_lenrek 4e5b596bba efi: ensure 8 byte alignment of buffer, as ReadBlocks() method will fail otherwise 2016-05-22 21:52:04 +02:00
cinap_lenrek 66b1a83b74 efi: allow access to iso filesystem on non-cdrom media (iso/hybrid) 2016-05-22 15:22:46 +02:00
cinap_lenrek 225b573624 9boot: add iso hybrid loader 9boothyb 2016-05-19 18:48:06 +02:00
cinap_lenrek 986886f2b8 retire the dec alpha port 2016-05-04 16:11:48 +02:00
cinap_lenrek bbc35cc01b 9boot: look for plan9.ini in all filesystems accessible to efi to find plan9 partition
try the handle buffer in reverse order looking for plan9.ini
to find plan9 partition (9fat). when that fails, we'll default
to the first handle which should be the esp.
2015-06-05 05:09:22 +02:00
cinap_lenrek aa0a20ed6e boot/zynq: use ./boothead.$cputype to invoke helper 2015-05-13 04:22:21 +02:00
cinap_lenrek 2d564a5004 boot/zynq: add jtagload utility 2015-05-13 04:12:49 +02:00
cinap_lenrek d57f23fb87 boot/zynq: implement sdmmc boot (fat) 2015-05-13 01:07:35 +02:00
mischief 3440516e04 pc, efi loaders: erase characters when backspace is pressed 2015-01-25 17:21:07 -08:00
aiju 7a3f0998a0 added zynq kernel 2014-12-24 10:21:51 +01:00
cinap_lenrek 634c55543a efi: generate /386/efiboot.fat for generating efi bootable cd images (see -E option of mk9660) 2014-10-31 20:07:54 +01:00
cinap_lenrek c7a5345aa6 efi: iso filesystem support for cdrom booting
instead of including kernel and config in the efi
fat image, we can just include the loaders and
read the plan9.ini and kernel from iso filesystem
just like the bios loaders.
2014-10-31 19:43:47 +01:00
cinap_lenrek 5f91d3f484 efi: add test targets for iso and fat (for documentation only) 2014-10-31 03:15:15 +01:00
cinap_lenrek fa3e71ab80 efi: change eficonfig ordering so memconf() is first, dont fallback to fs when /cfg/pxe/ file isnt there
having the memconf() (*e820=) last clutters the screen.
do it first, so we can read *acpi= and *bootscreen=
prints.

we want to continue using tftp even when the /cfg/pxe/$ether
file is not found. only when we detect no pxe/dhcp session,
then we switch to local filesystem (non-network boot).
2014-10-24 00:40:09 +02:00
cinap_lenrek 16e08adb32 efi: add initial pxe support (v4 only) 2014-10-23 23:11:49 +02:00
cinap_lenrek d7785060fb efi: use LocateHandle() and HandleProtocol() to check for multiple gop protocols to find a usable one
the gop returned by LocateProtocol() is not usable on thinkpad x230,
so iterate over all handles to find a usable one.
2014-10-19 19:55:45 +02:00
cinap_lenrek d6ea496960 efi: fix compiler warnings, remove indicator prints in readn() 2014-10-19 22:01:13 +02:00
cinap_lenrek f0ff0fb054 efi: simplify bootscreen code 2014-10-18 19:15:53 +02:00
cinap_lenrek 99e004c72e efi: convert pixel format to bootscreen color channel 2014-10-18 18:48:56 +02:00
cinap_lenrek 6aa6e9fc8b efi: make clean target virtual 2014-10-18 02:15:40 +02:00
cinap_lenrek 6f3dfb57eb efi: add experimental efi bootloader
this is basically a port of 9boot to EFI. theres
support for IA32 (386) and X64 (amd64).

has been tested only under qemu with OVMF so far.
2014-10-18 02:13:02 +02:00
cinap_lenrek 365fd745d6 9bootfat: only check for fat at block 0 on floppy drives (thanks aap)
smart boot manager has a "FAT" signature in its mbr causing
9bootfat to "detect" it as a fat filesystem and then fails
to find plan9.ini.

there shouldnt be a fat filesystem on harddrives at block 0, only
on floppy drives. but some bioses use floppy drive numbers
for usb harddrives so still check for a partition table.

thanks aap for debugging this.
2013-09-23 21:12:41 +02:00
cinap_lenrek b14138c2ae 9bootfat: always try plan9 partition even when not marked active, fix bug
always look for 9fat in plan9 partition even tho the partition
is *not* maked active. marking partitions active is not
recommended anymore with grub so this makes life easier for
some people. multiple plan9 partitions on a single drive
is not supported.

have to copy partition table as buf gets trashed when reading
first block of fat partition. it worked only when the first
fat partition found (the one marked active) was the right one,
but conffat() can fail.
2013-09-01 21:18:11 +02:00
cinap_lenrek cd66b11f67 pbs: allow 9bootfat start cluster beyond 0xFFFF
pbs failed to load (silently loading garbage) 9BOOTFAT from start
cluster beyond FFFF because we ignored the low word from the
directory entry. now taking the high 16 bit of the directory's
start cluster into account.
2013-05-06 01:15:46 +02:00
cinap_lenrek 2fc31e9a70 9boot: fix 9bootiso
rearrange sub.c for putc(), readn(), memcmp(), memmove(), strchr() and strlen()
and uart to fit into the first 2K of the image.
2013-02-18 04:16:33 +01:00
cinap_lenrek c9c06dd8ba 9boot: serial console support 2013-02-18 01:22:29 +01:00
cinap_lenrek 364f1f78d4 9boot: make print handle \n -> \r\n conversion, style 2013-02-17 21:48:51 +01:00
cinap_lenrek 3da5b76c0b 9boot: preserve configuration on boot error, add show command 2013-02-17 09:30:02 +01:00