summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Gupta <ashmew2@gmail.com>2017-05-31 00:35:19 +0200
committerAshish Gupta <ashmew2@gmail.com>2017-10-25 22:04:54 +0200
commit2a6495e8ef0029d2833313034022780660d7004a (patch)
tree05b24882265b1d209758924d376ceb44ab018835
parent22919f5f01a3495a9b318e25d19ff9e0b3945e1d (diff)
downloadnetsurf-2a6495e8ef0029d2833313034022780660d7004a.tar.gz
netsurf-2a6495e8ef0029d2833313034022780660d7004a.tar.bz2
Release nightly for KolibriOS.
Check board.kolibrios.org forum thread for Netsurf for more details.
-rw-r--r--Makefile3
-rw-r--r--content/fetchers/file.c33
-rw-r--r--content/fetchers/httplib_kolibri.c8
-rw-r--r--frontends/kolibrios/Makefile7
-rw-r--r--frontends/kolibrios/fb/gui.c6
-rw-r--r--frontends/kolibrios/kos32sys.h13
6 files changed, 60 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index cc0c44099..6b7e3d5ef 100644
--- a/Makefile
+++ b/Makefile
@@ -289,7 +289,8 @@ else
endif
else
ifeq ($(TARGET),kolibrios)
- CROSSDIR := /opt/netsurf/kos32-gcc/cross/autobuild/tools/win32/bin
+# CROSSDIR := /opt/netsurf/kos32-gcc/cross/autobuild/tools/win32/bin
+ CROSSDIR := /home/autobuild/tools/win32/bin
ENVDIR := /opt/netsurf/kos32-gcc/env/
CC := $(CROSSDIR)/kos32-gcc
LD := $(CROSSDIR)/kos32-ld
diff --git a/content/fetchers/file.c b/content/fetchers/file.c
index 067d9be50..1aeb40b5b 100644
--- a/content/fetchers/file.c
+++ b/content/fetchers/file.c
@@ -42,6 +42,21 @@
#ifdef HAVE_MMAP
#include <sys/mman.h>
#endif
+
+#ifdef _TARGET_IS_KOLIBRIOS
+static inline uint32_t sys_uptime(void)
+{
+ uint32_t uptime;
+
+ __asm__ __volatile__(
+ "int $0x40 \n\t"
+ :"=a"(uptime)
+ :"a"(26),"b"(9));
+
+ return uptime / 100;
+}
+#endif
+
#include <libwapcaplet/libwapcaplet.h>
#include "netsurf/inttypes.h"
@@ -191,6 +206,11 @@ static void fetch_file_free(void *ctx)
/** callback to start a file fetch */
static bool fetch_file_start(void *ctx)
{
+#ifdef _TARGET_IS_KOLIBRIOS
+ struct fetch_file_context *c = ctx;
+ debug_board_printf("[%u] Starting file fetch : %s\n", sys_uptime(), nsurl_access(c->url));
+#endif
+
return true;
}
@@ -250,6 +270,9 @@ static void fetch_file_process_error(struct fetch_file_context *ctx, int code)
if (fetch_file_send_callback(&msg, ctx))
goto fetch_file_process_error_aborted;
+#ifdef _TARGET_IS_KOLIBRIOS
+ debug_board_printf("[%u] Finished file fetch : %s\n", sys_uptime(), nsurl_access(ctx->url));
+#endif
msg.type = FETCH_FINISHED;
fetch_file_send_callback(&msg, ctx);
@@ -332,6 +355,9 @@ static void fetch_file_process_plain(struct fetch_file_context *ctx,
fetch_file_send_callback(&msg, ctx);
if (ctx->aborted == false) {
+#ifdef _TARGET_IS_KOLIBRIOS
+ debug_board_printf("[%u] Finished file fetch : %s\n", sys_uptime(), nsurl_access(ctx->url));
+#endif
msg.type = FETCH_FINISHED;
fetch_file_send_callback(&msg, ctx);
}
@@ -435,6 +461,9 @@ fetch_file_process_aborted:
}
if (ctx->aborted == false) {
+#ifdef _TARGET_IS_KOLIBRIOS
+ debug_board_printf("[%u] Finished file fetch : %s\n", sys_uptime(), nsurl_access(ctx->url));
+#endif
msg.type = FETCH_FINISHED;
fetch_file_send_callback(&msg, ctx);
}
@@ -741,6 +770,10 @@ static void fetch_file_process_dir(struct fetch_file_context *ctx,
if (fetch_file_send_callback(&msg, ctx))
goto fetch_file_process_dir_aborted;
+#ifdef _TARGET_IS_KOLIBRIOS
+ debug_board_printf("[%u] Finished file fetch : %s\n", sys_uptime(), nsurl_access(ctx->url));
+#endif
+
msg.type = FETCH_FINISHED;
fetch_file_send_callback(&msg, ctx);
diff --git a/content/fetchers/httplib_kolibri.c b/content/fetchers/httplib_kolibri.c
index d3f268983..d5a52c30d 100644
--- a/content/fetchers/httplib_kolibri.c
+++ b/content/fetchers/httplib_kolibri.c
@@ -76,10 +76,14 @@ bool init_fetcher(lwc_string *scheme) {
assert(lwc_string_isequal(scheme, corestring_lwc_http, &supported_scheme) == lwc_error_ok);
LOG("Initializing http library!");
- if(kolibri_http_init() == 0)
+ debug_board_printf("---- [NETSURF] Trying to initialize http library.\n");
+ if(kolibri_http_init() == 0) {
LOG("[INFO] Loaded http.obj library successfully.\n");
+ debug_board_printf("---- [NETSURF] Successfully initialized http library.\n");
+ }
else {
LOG("[ERROR] Could not load http.obj library.\n");
+ debug_board_printf("---- [NETSURF] Could not initialize http library. Exiting.\n");
assert(0 && 1);
return false;
}
@@ -151,6 +155,7 @@ void *setup_fetch(struct fetch *parent_fetch, struct nsurl *url,
bool start_fetch(void *httpf) {
LOG("-=- start_fetch : httpf: 0x%x", httpf);
+
add_to_poll((struct httpfetcher *) httpf);
return true;
}
@@ -308,6 +313,7 @@ void poll_fetch(lwc_string *scheme) {
}
fetch_msg msg;
+
msg.type = FETCH_FINISHED;
msg.data.header_or_data.buf = NULL;
msg.data.header_or_data.len = 0;
diff --git a/frontends/kolibrios/Makefile b/frontends/kolibrios/Makefile
index 963b085de..c1496de48 100644
--- a/frontends/kolibrios/Makefile
+++ b/frontends/kolibrios/Makefile
@@ -4,7 +4,7 @@ KOL_OBJ_DIR := $(ENVDIR)/obj
KOL_LIBC := $(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/sources/newlib/libc/include/
KOL_LIB_DIR := $(KOLIBRI_SVN_CHECKOUT)/contrib/sdk/lib
-LIB_LDFLAGS := -L$(KOL_LIB_DIR) -lfreetype -lpng16 -ljpeg
+LIB_LDFLAGS := -L$(KOL_LIB_DIR) -lfreetype
OS_LDFLAGS := -static -S -Tapp-dynamic.lds --image-base 0 -Map netsurf-kolibrios.map
NS_INCLUDE := $(PREFIX)/include
NS_LIB_LDFLAGS := -L$(PREFIX)/lib/ -lnsbmp -lnsutils -lwapcaplet -lsvgtiny -lnsgif -lutf8proc -lcss -lnsfb -lparserutils -ldom -lhubbub
@@ -22,11 +22,6 @@ CFLAGS += '-DNETSURF_USE_KOLIBRI_HTTPLIB'
# Only for FB compat with kolibri. Get rid soon.
CFLAGS += '-DKOLIBRI_RUNTIME_RESPATH="$(NETSURF_KOLIBRI_RESPATH)"'
-# Enable PNG and others from here (no pkg config for now)
-CFLAGS += '-DWITH_PNG'
-CFLAGS += '-DWITH_GIF'
-CFLAGS += '-DWITH_JPEG'
-
# compile time font locations
CFLAGS += '-DNETSURF_FB_FONTPATH="$(NETSURF_KOLIBRI_FONTPATH)"'
CFLAGS += '-DKOLIBRI_FONT_FREETYPE_SANS_SERIF="$(NETSURF_KOLIBRI_FONT_SANS_SERIF)"'
diff --git a/frontends/kolibrios/fb/gui.c b/frontends/kolibrios/fb/gui.c
index 6d21b737e..bded72245 100644
--- a/frontends/kolibrios/fb/gui.c
+++ b/frontends/kolibrios/fb/gui.c
@@ -489,7 +489,7 @@ process_cmdline(int argc, char** argv)
/* Remove me! */
/* feurl = "file:///usbhd0/1/bin/res/text.html"; */
- feurl = "http://board.kolibrios.org";
+ /* feurl = "http://board.kolibrios.org"; */
/* NS on KolibriOS does not support option parsing (yet) */
@@ -2117,6 +2117,8 @@ static struct gui_misc_table framebuffer_misc_table = {
*/
int main(int argc, char** argv)
{
+ debug_board_printf("--- [NETSURF] Starting Netsurf for KolibriOS.\n");
+
struct browser_window *bw;
char *options;
char *messages;
@@ -2136,7 +2138,7 @@ int main(int argc, char** argv)
/* Initialize heap so that we can do memory allocations */
unsigned int heapsize = heap_init();
- LOG("[SYSTEM] Initialized heap (Size = %u bytes)\n", heapsize);
+ debug_board_printf("--- [NETSURF] Initialized heap.\n");
assert(heapsize != 0);
/* fix args */
diff --git a/frontends/kolibrios/kos32sys.h b/frontends/kolibrios/kos32sys.h
index de4bf6aae..18ac3fa22 100644
--- a/frontends/kolibrios/kos32sys.h
+++ b/frontends/kolibrios/kos32sys.h
@@ -536,6 +536,19 @@ static inline void Blit(void *bitmap, int dst_x, int dst_y,
::"a"(73),"b"(0),"c"(&bc.dstx));
};
+static inline uint32_t sys_uptime(void)
+{
+ uint32_t uptime;
+
+ __asm__ __volatile__(
+ "int $0x40 \n\t"
+ :"=a"(uptime)
+ :"a"(26),"b"(9));
+
+ return uptime / 100;
+}
+
+
void* load_library(const char *name);
void* get_proc_address(void *handle, const char *proc_name);